Version Description
Nothing for now
Download this release
Release Info
Developer | alticreation |
Plugin | Protect uploads |
Version | 0.2 |
Comparing to | |
See all releases |
Code changes from version 0.1 to 0.2
- admin/assets/css/protect-uploads-admin.css +12 -1
- admin/class-protect-uploads-admin.php +10 -15
- admin/views/includes/protect-uploads-admin-sidebar.php +144 -0
- admin/views/protect-uploads-admin-settings-page.php +12 -13
- languages/protect-uploads-it_IT.mo +0 -0
- languages/protect-uploads-it_IT.po +197 -0
- protect-uploads.php +2 -2
- readme.txt +9 -2
admin/assets/css/protect-uploads-admin.css
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
}
|
4 |
#wrap.protect-uploads h2 span, #wrap.protect-uploads h2 span * {
|
5 |
font-size: 14px;
|
6 |
-
color: #
|
7 |
}
|
8 |
#wrap.protect-uploads .description {
|
9 |
color: #666;
|
@@ -66,4 +66,15 @@
|
|
66 |
background: #238ECB;
|
67 |
color: #fff;
|
68 |
margin: 0 5px 0 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
}
|
3 |
}
|
4 |
#wrap.protect-uploads h2 span, #wrap.protect-uploads h2 span * {
|
5 |
font-size: 14px;
|
6 |
+
color: #888;
|
7 |
}
|
8 |
#wrap.protect-uploads .description {
|
9 |
color: #666;
|
66 |
background: #238ECB;
|
67 |
color: #fff;
|
68 |
margin: 0 5px 0 0;
|
69 |
+
}
|
70 |
+
|
71 |
+
/* container left and right */
|
72 |
+
#wrap.protect-uploads .protect-uploads-main-container {
|
73 |
+
float: left;
|
74 |
+
width: 66%;
|
75 |
+
}
|
76 |
+
#wrap.protect-uploads .protect-uploads-sidebar {
|
77 |
+
float: left;
|
78 |
+
width: 31%;
|
79 |
+
margin-left: 2%;
|
80 |
}
|
admin/class-protect-uploads-admin.php
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
<?php
|
2 |
|
3 |
class Alti_ProtectUploads_Admin {
|
4 |
|
@@ -107,7 +107,7 @@ class Alti_ProtectUploads_Admin {
|
|
107 |
|
108 |
|
109 |
/**
|
110 |
-
*
|
111 |
*/
|
112 |
public function create_index() {
|
113 |
// check if index php does not exists
|
@@ -116,7 +116,7 @@ class Alti_ProtectUploads_Admin {
|
|
116 |
$indexContent = "<!-- \n Generated by " . $this->get_plugin_name() . " \n http://www.alticreation.com/en/protect-uploads/ \n date:" . date('d/m/Y') . "\n--><?php // Silence is golden";
|
117 |
$i = 0;
|
118 |
foreach (self::get_uploads_subdirectories() as $subDirectory) {
|
119 |
-
|
120 |
if( !file_put_contents( $subDirectory.'/'.'index.php', $indexContent ) ) {
|
121 |
$this->messages['file'][] = array(
|
122 |
'message' => __('Impossible to create or modified the index.php file in '. $subDirectory, $this->get_plugin_name()),
|
@@ -128,14 +128,14 @@ class Alti_ProtectUploads_Admin {
|
|
128 |
update_option( $this->get_plugin_name().'-protection', 'index_php' );
|
129 |
$i++;
|
130 |
}
|
131 |
-
|
132 |
}
|
133 |
|
134 |
if($i == count(self::get_uploads_subdirectories())) {
|
135 |
$this->messages['file'][] = array(
|
136 |
'message' => __('The index.php file has been created in main folder and subfolders (two levels max).', $this->get_plugin_name()),
|
137 |
'type' => 'updated'
|
138 |
-
);
|
139 |
}
|
140 |
|
141 |
}
|
@@ -150,7 +150,7 @@ class Alti_ProtectUploads_Admin {
|
|
150 |
}
|
151 |
|
152 |
/**
|
153 |
-
*
|
154 |
*/
|
155 |
public function create_htaccess() {
|
156 |
// prepare htaccess Content
|
@@ -192,7 +192,7 @@ class Alti_ProtectUploads_Admin {
|
|
192 |
'type' => 'updated'
|
193 |
);
|
194 |
|
195 |
-
}
|
196 |
else {
|
197 |
$this->messages['file'][] = array(
|
198 |
'message' => 'The existing htaccess file couldn\'t be updated. Please check file permissions.',
|
@@ -213,8 +213,8 @@ class Alti_ProtectUploads_Admin {
|
|
213 |
if(file_exists( $subDirectory .'/index.php' )) {
|
214 |
unlink( $subDirectory .'/index.php' );
|
215 |
$i++;
|
216 |
-
}
|
217 |
-
|
218 |
}
|
219 |
if( $i == count(self::get_uploads_subdirectories()) ) {
|
220 |
$this->messages['file'][] = array(
|
@@ -273,12 +273,7 @@ class Alti_ProtectUploads_Admin {
|
|
273 |
}
|
274 |
// check if header is 403 (forbidden)
|
275 |
if( preg_match('/403/i', $uploads_headers[0] )) {
|
276 |
-
|
277 |
-
return true;
|
278 |
-
}
|
279 |
-
else {
|
280 |
-
return true;
|
281 |
-
}
|
282 |
}
|
283 |
|
284 |
}
|
1 |
+
<?php
|
2 |
|
3 |
class Alti_ProtectUploads_Admin {
|
4 |
|
107 |
|
108 |
|
109 |
/**
|
110 |
+
*
|
111 |
*/
|
112 |
public function create_index() {
|
113 |
// check if index php does not exists
|
116 |
$indexContent = "<!-- \n Generated by " . $this->get_plugin_name() . " \n http://www.alticreation.com/en/protect-uploads/ \n date:" . date('d/m/Y') . "\n--><?php // Silence is golden";
|
117 |
$i = 0;
|
118 |
foreach (self::get_uploads_subdirectories() as $subDirectory) {
|
119 |
+
|
120 |
if( !file_put_contents( $subDirectory.'/'.'index.php', $indexContent ) ) {
|
121 |
$this->messages['file'][] = array(
|
122 |
'message' => __('Impossible to create or modified the index.php file in '. $subDirectory, $this->get_plugin_name()),
|
128 |
update_option( $this->get_plugin_name().'-protection', 'index_php' );
|
129 |
$i++;
|
130 |
}
|
131 |
+
|
132 |
}
|
133 |
|
134 |
if($i == count(self::get_uploads_subdirectories())) {
|
135 |
$this->messages['file'][] = array(
|
136 |
'message' => __('The index.php file has been created in main folder and subfolders (two levels max).', $this->get_plugin_name()),
|
137 |
'type' => 'updated'
|
138 |
+
);
|
139 |
}
|
140 |
|
141 |
}
|
150 |
}
|
151 |
|
152 |
/**
|
153 |
+
*
|
154 |
*/
|
155 |
public function create_htaccess() {
|
156 |
// prepare htaccess Content
|
192 |
'type' => 'updated'
|
193 |
);
|
194 |
|
195 |
+
}
|
196 |
else {
|
197 |
$this->messages['file'][] = array(
|
198 |
'message' => 'The existing htaccess file couldn\'t be updated. Please check file permissions.',
|
213 |
if(file_exists( $subDirectory .'/index.php' )) {
|
214 |
unlink( $subDirectory .'/index.php' );
|
215 |
$i++;
|
216 |
+
}
|
217 |
+
|
218 |
}
|
219 |
if( $i == count(self::get_uploads_subdirectories()) ) {
|
220 |
$this->messages['file'][] = array(
|
273 |
}
|
274 |
// check if header is 403 (forbidden)
|
275 |
if( preg_match('/403/i', $uploads_headers[0] )) {
|
276 |
+
return true;
|
|
|
|
|
|
|
|
|
|
|
277 |
}
|
278 |
|
279 |
}
|
admin/views/includes/protect-uploads-admin-sidebar.php
ADDED
@@ -0,0 +1,144 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$get_from = 'protect-uploads';
|
3 |
+
|
4 |
+
$paypal_svg = '
|
5 |
+
<svg xmlns="http://www.w3.org/2000/svg" width="124" height="33" viewBox="0 0 124 33"><path fill="#253B80" d="M46.21 6.75h-6.838c-.468 0-.866.34-.94.8L35.668 25.09c-.055.346.213.658.564.658h3.266c.468 0 .866-.34.94-.803l.745-4.73c.073-.463.472-.803.94-.803h2.164c4.505 0 7.105-2.18 7.784-6.5.306-1.89.013-3.375-.872-4.415C50.224 7.353 48.5 6.75 46.21 6.75zm.79 6.404c-.374 2.454-2.25 2.454-4.062 2.454h-1.032l.724-4.583c.043-.277.283-.48.563-.48h.473c1.235 0 2.4 0 3.002.703.36.42.47 1.044.332 1.906zM66.654 13.075H63.38c-.28 0-.52.204-.564.48l-.145.917-.228-.332c-.71-1.03-2.29-1.373-3.868-1.373-3.62 0-6.71 2.74-7.312 6.586-.313 1.918.132 3.752 1.22 5.03.998 1.177 2.426 1.667 4.125 1.667 2.916 0 4.533-1.875 4.533-1.875l-.146.91c-.055.348.213.66.562.66h2.95c.47 0 .865-.34.94-.803l1.77-11.21c.055-.344-.212-.657-.562-.657zM62.09 19.45c-.317 1.87-1.802 3.126-3.696 3.126-.95 0-1.71-.305-2.2-.883-.483-.574-.667-1.39-.513-2.3.296-1.856 1.806-3.153 3.67-3.153.93 0 1.687.31 2.185.892.5.59.697 1.41.554 2.317zM84.096 13.075h-3.29c-.315 0-.61.156-.788.417l-4.54 6.686-1.923-6.425c-.12-.402-.492-.678-.912-.678H69.41c-.394 0-.667.384-.542.754l3.625 10.637-3.408 4.81c-.268.38.002.9.465.9h3.287c.312 0 .604-.15.78-.407l10.947-15.8c.262-.378-.007-.895-.468-.895z"/><path fill="#179BD7" d="M94.992 6.75h-6.84c-.467 0-.865.34-.938.8L84.448 25.09c-.055.346.213.658.562.658h3.51c.326 0 .605-.238.656-.562l.785-4.97c.073-.464.472-.804.94-.804h2.163c4.506 0 7.105-2.18 7.785-6.5.307-1.89.012-3.375-.873-4.415-.97-1.142-2.694-1.746-4.983-1.746zm.79 6.404c-.374 2.454-2.25 2.454-4.063 2.454h-1.032l.725-4.583c.043-.277.28-.48.562-.48h.473c1.234 0 2.4 0 3.002.703.36.42.468 1.044.33 1.906zM115.434 13.075h-3.273c-.28 0-.52.204-.56.48l-.146.917-.23-.332c-.71-1.03-2.29-1.373-3.867-1.373-3.62 0-6.71 2.74-7.31 6.586-.313 1.918.13 3.752 1.218 5.03 1 1.177 2.426 1.667 4.125 1.667 2.916 0 4.533-1.875 4.533-1.875l-.146.91c-.055.348.213.66.564.66h2.95c.467 0 .865-.34.938-.803l1.77-11.21c.055-.344-.213-.657-.564-.657zm-4.565 6.374c-.315 1.87-1.802 3.126-3.696 3.126-.95 0-1.71-.305-2.2-.883-.483-.574-.665-1.39-.513-2.3.298-1.856 1.806-3.153 3.67-3.153.93 0 1.687.31 2.185.892.5.59.7 1.41.554 2.317zM119.295 7.23l-2.807 17.858c-.055.346.213.658.562.658h2.822c.47 0 .867-.34.94-.803l2.767-17.536c.054-.346-.214-.66-.563-.66h-3.16c-.28.002-.52.206-.562.483z"/><path fill="#253B80" d="M7.266 29.154l.523-3.322-1.166-.027H1.06L4.928 1.292c.012-.074.05-.143.108-.192.057-.05.13-.076.206-.076h9.38c3.115 0 5.264.648 6.386 1.927.526.6.86 1.228 1.023 1.918.17.724.172 1.59.006 2.644l-.012.077v.675l.526.298c.443.235.795.504 1.065.812.45.513.74 1.165.864 1.938.126.795.084 1.74-.124 2.812-.24 1.232-.628 2.305-1.152 3.183-.482.81-1.096 1.48-1.825 2-.697.494-1.524.87-2.46 1.11-.905.235-1.938.354-3.07.354h-.73c-.523 0-1.03.188-1.428.525-.4.344-.663.814-.744 1.328l-.055.3-.924 5.854-.043.214c-.01.068-.03.102-.058.125-.026.02-.062.034-.097.034H7.266z"/><path fill="#179BD7" d="M23.048 7.667c-.028.18-.06.362-.096.55-1.237 6.35-5.47 8.545-10.874 8.545H9.326c-.66 0-1.218.48-1.32 1.132l-1.41 8.936-.4 2.533c-.066.428.264.814.696.814h4.88c.58 0 1.07-.42 1.16-.99l.05-.248.918-5.833.06-.32c.09-.572.58-.992 1.16-.992h.73c4.728 0 8.43-1.92 9.512-7.476.452-2.322.218-4.26-.978-5.623-.362-.41-.81-.752-1.336-1.03z"/><path fill="#222D65" d="M21.754 7.15c-.19-.054-.384-.104-.584-.15-.2-.043-.407-.082-.62-.116-.74-.12-1.554-.177-2.425-.177h-7.352c-.18 0-.353.04-.507.115-.34.163-.59.484-.652.877L8.05 17.604l-.045.29c.103-.653.66-1.133 1.32-1.133h2.753c5.405 0 9.637-2.195 10.874-8.545.037-.188.068-.37.096-.55-.313-.166-.652-.308-1.017-.43-.09-.03-.182-.058-.276-.086z"/><path fill="#253B80" d="M9.614 7.7c.06-.394.313-.715.652-.877.155-.074.326-.115.507-.115h7.352c.87 0 1.684.057 2.426.177.213.034.42.073.62.117.2.045.395.095.584.15.094.028.187.057.278.086.365.12.704.264 1.017.43.367-2.348-.004-3.946-1.273-5.393C20.377.682 17.853 0 14.622 0h-9.38c-.66 0-1.223.48-1.325 1.133L.01 25.898c-.077.49.3.932.795.932h5.79l1.455-9.225L9.614 7.7z"/></svg>
|
6 |
+
';
|
7 |
+
?>
|
8 |
+
<style>
|
9 |
+
.alti_promote_widget {
|
10 |
+
background-color: #fff;
|
11 |
+
padding: 10px;
|
12 |
+
margin: 15px 0;
|
13 |
+
border: 1px solid #E5E5E5;
|
14 |
+
position: relative;
|
15 |
+
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
|
16 |
+
overflow: hidden;
|
17 |
+
}
|
18 |
+
|
19 |
+
.alti_promote_widget .dashicons {
|
20 |
+
color: #238ECB !important;
|
21 |
+
}
|
22 |
+
|
23 |
+
.alti_promote_plugin {
|
24 |
+
margin: 5px 0 5px -5px;
|
25 |
+
clear: both;
|
26 |
+
overflow: hidden;
|
27 |
+
}
|
28 |
+
|
29 |
+
.alti_promote_plugin a {
|
30 |
+
position: relative;
|
31 |
+
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
|
32 |
+
float: left;
|
33 |
+
display: block;
|
34 |
+
margin-right: 5px;
|
35 |
+
width: 100%;
|
36 |
+
text-decoration: none;
|
37 |
+
border: 5px solid transparent;
|
38 |
+
}
|
39 |
+
|
40 |
+
.alti_promote_plugin a:hover {
|
41 |
+
background-color: #eee;
|
42 |
+
border: 5px solid #eee;
|
43 |
+
}
|
44 |
+
|
45 |
+
.alti_promote_plugin img {
|
46 |
+
width: 50px;
|
47 |
+
height: 50px;
|
48 |
+
margin-right: 10px;
|
49 |
+
display: block;
|
50 |
+
float: left;
|
51 |
+
}
|
52 |
+
|
53 |
+
.alti_promote_plugin .alti_promote_copy {
|
54 |
+
color: #555;
|
55 |
+
}
|
56 |
+
|
57 |
+
.alti_promote_plugin .alti_promote_copy strong {
|
58 |
+
display: block;
|
59 |
+
color: #333;
|
60 |
+
}
|
61 |
+
|
62 |
+
.alti_promote_title {
|
63 |
+
font-size: 1.2em;
|
64 |
+
font-weight: bold;
|
65 |
+
color: #222;
|
66 |
+
margin-bottom: 12.5px;
|
67 |
+
}
|
68 |
+
|
69 |
+
.alti_promote_title span:before {
|
70 |
+
color: #222;
|
71 |
+
}
|
72 |
+
|
73 |
+
.alti_promote_btn {
|
74 |
+
background: rgba(35, 142, 203, 0.3);
|
75 |
+
display: inline-block;
|
76 |
+
padding: 2.5px 5px;
|
77 |
+
border-radius: 2.5px;
|
78 |
+
text-decoration: none;
|
79 |
+
color: #333;
|
80 |
+
}
|
81 |
+
|
82 |
+
.alti_promote_paypal {
|
83 |
+
color: #021E73;
|
84 |
+
font-weight: bold;
|
85 |
+
text-shadow: 2px 2px 0 #1189D6;
|
86 |
+
display: inline-block;
|
87 |
+
background-color: #fff;
|
88 |
+
padding: 0 5px;
|
89 |
+
border-radius: 15px;
|
90 |
+
font-size: 1.2em;
|
91 |
+
line-height: 1.3em;
|
92 |
+
font-family: sans-serif;
|
93 |
+
border: 1px solid #ccc;
|
94 |
+
}
|
95 |
+
|
96 |
+
.alti_promote_paypal_svg svg {
|
97 |
+
height: 15px;
|
98 |
+
width: 65px;
|
99 |
+
vertical-align: middle;
|
100 |
+
}
|
101 |
+
</style>
|
102 |
+
<div class="alti-watermark-sidebar">
|
103 |
+
<div class="alti_promote_widget">
|
104 |
+
<div class="alti_promote_title">Like this plugin?</div>
|
105 |
+
<p><span class="dashicons dashicons-arrow-right-alt2"></span><a target="_blank" class="alti_promote_btn" href="https://wordpress.org/support/view/plugin-reviews/<?php echo $get_from; ?>?rate=5#postform"><strong>Rate it</strong></a> to show your support!</p>
|
106 |
+
<p><span class="dashicons dashicons-arrow-right-alt2"></span><a target="_blank" class="alti_promote_btn" href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=9S74KTRCZCLRE&item_name=<?php echo $get_from; ?>&no_note=0&no_shipping=1¤cy_code=USD"><strong>Donate</strong> <span class="alti_promote_paypal_svg"><?php echo $paypal_svg; ?></span></a> to encourage me updating this plugin!</p>
|
107 |
+
</div>
|
108 |
+
<div class="alti_promote_widget">
|
109 |
+
<div class="alti_promote_title">Discover more useful plugins</div>
|
110 |
+
<?php $related_plugins = array(
|
111 |
+
array(
|
112 |
+
'protect-uploads',
|
113 |
+
'Protect Uploads',
|
114 |
+
'Helps you protect your uploads folder.'
|
115 |
+
),
|
116 |
+
array(
|
117 |
+
'alti-watermark',
|
118 |
+
'Watermark',
|
119 |
+
'Add watermark on your images.'
|
120 |
+
),
|
121 |
+
array(
|
122 |
+
'altibox',
|
123 |
+
'Altibox',
|
124 |
+
'Add a minimalist lightbox viewer.'
|
125 |
+
),
|
126 |
+
); ?>
|
127 |
+
<?php foreach ($related_plugins as $related_plugin): ?>
|
128 |
+
<?php if( $related_plugin[0] != $get_from ) { ?>
|
129 |
+
<div class="alti_promote_plugin">
|
130 |
+
<a href="plugin-install.php?tab=search&type=term&s=alticreation+<?php echo urlencode($related_plugin[0]); ?>" title="<?php echo $related_plugin[1]; ?>"><img src="https://plugins.svn.wordpress.org/<?php echo $related_plugin[0]; ?>/assets/icon-128x128.png" alt="<?php echo $related_plugin[1]; ?>">
|
131 |
+
<div class="alti_promote_copy">
|
132 |
+
<strong><?php echo $related_plugin[1]; ?></strong>
|
133 |
+
<?php echo $related_plugin[2]; ?>
|
134 |
+
</div>
|
135 |
+
</a>
|
136 |
+
</div>
|
137 |
+
<?php } ?>
|
138 |
+
<?php endforeach ?>
|
139 |
+
</div>
|
140 |
+
<div class="alti_promote_widget">
|
141 |
+
<div class="alti_promote_title">Developed by</div>
|
142 |
+
<a href="http://www.alticreation.com?utm_source=wp_plugin&utm_medium=logo_sidebar&utm_campaign=<?php echo $get_from; ?>"><img src="http://alticreation.com/logos/alticreation_color_01.png" alt="alticreation"></a>
|
143 |
+
</div>
|
144 |
+
</div>
|
admin/views/protect-uploads-admin-settings-page.php
CHANGED
@@ -1,15 +1,18 @@
|
|
1 |
<div id="wrap" class="<?php echo $this->plugin_name ?>">
|
2 |
<?php
|
3 |
$plugin = new Alti_ProtectUploads_Admin($this->plugin_name, $this->version);
|
4 |
-
if($_POST) {
|
5 |
$plugin->save_form( $_POST );
|
6 |
}
|
7 |
$plugin->display_messages();
|
8 |
?>
|
9 |
-
<h2>Protect Uploads
|
10 |
<p class="description"><?php _e('Prevent users to browse your uploads directory. You\'ll protect your uploads directory to be accessed and content stolen too easily in one batch.', $this->plugin_name); ?></p>
|
|
|
11 |
<form method="POST" enctype="multipart/form-data">
|
12 |
|
|
|
|
|
13 |
<table class="form-table">
|
14 |
<tbody>
|
15 |
<tr>
|
@@ -41,13 +44,13 @@
|
|
41 |
<!-- -->
|
42 |
<label for="protection_1">
|
43 |
<input type="radio" value="index_php" name="protection" id="protection_1" <?php if( get_option( $this->plugin_name . '-protection') == 'index_php' ) { ?>checked<?php } ?>>
|
44 |
-
<strong><?php _e('add index file', $this->plugin_name); ?></strong>
|
45 |
<p class="description"><?php _e('This will create an index.php file on the root of your uploads directory. This simple trick will hide the content of your whole uploads directory.', $this->plugin_name); ?></p>
|
46 |
</label><br>
|
47 |
<!-- -->
|
48 |
<label for="protection_2">
|
49 |
<input type="radio" value="htaccess" name="protection" id="protection_2" <?php if( get_option( $this->plugin_name . '-protection') == 'htaccess' ) { ?>checked<?php } ?>>
|
50 |
-
<strong><?php _e('prevent directory listing with htaccess', $this->plugin_name); ?></strong>
|
51 |
<p class="description"><?php _e('Through the htaccess file, it will prevent people to browse your uploads directory and return a 403 code (Forbidden Access).', $this->plugin_name); ?></p>
|
52 |
</label><br>
|
53 |
<!-- -->
|
@@ -57,7 +60,7 @@
|
|
57 |
<p class="description"><?php _e('Your uploads directory is not protected.', $this->plugin_name); ?></p>
|
58 |
</label><br>
|
59 |
</fieldset>
|
60 |
-
|
61 |
</td>
|
62 |
</tr>
|
63 |
<tr>
|
@@ -89,14 +92,10 @@
|
|
89 |
</table>
|
90 |
|
91 |
</form>
|
92 |
-
|
93 |
-
<a class="logo" href="http://www.alticreation.com?plugin=protect-uploads"><img src="http://alticreation.com/logos/alticreation_color_01.png" alt="alticreation"></a>
|
94 |
-
<p><?php _e('Protect Uploads plugin is developped by', $this->plugin_name); ?> <a href="http://www.alticreation.com/en/profile">Alexis Blondin</a>.</p>
|
95 |
-
<div class="share">
|
96 |
-
<a href="http://www.alticreation.com?plugin=protect-uploads" target="_blank">alticreation.com</a>
|
97 |
-
<a href="https://plus.google.com/+AlexisBlondin" target="_blank">google +</a>
|
98 |
-
<a href="https://twitter.com/alticreation" target="_blank">twitter</a>
|
99 |
-
</div>
|
100 |
</div>
|
|
|
|
|
|
|
101 |
</div>
|
102 |
|
1 |
<div id="wrap" class="<?php echo $this->plugin_name ?>">
|
2 |
<?php
|
3 |
$plugin = new Alti_ProtectUploads_Admin($this->plugin_name, $this->version);
|
4 |
+
if( isset($_POST['submit']) && check_admin_referer( 'submit_form', 'protect-uploads'. '_nonce' ) ) {
|
5 |
$plugin->save_form( $_POST );
|
6 |
}
|
7 |
$plugin->display_messages();
|
8 |
?>
|
9 |
+
<h2>Protect Uploads <span><?php _e('by', $this->plugin_name); ?> <a href="https://www.alticreation.com/en">alticreation.com</a></span></h2>
|
10 |
<p class="description"><?php _e('Prevent users to browse your uploads directory. You\'ll protect your uploads directory to be accessed and content stolen too easily in one batch.', $this->plugin_name); ?></p>
|
11 |
+
<div class="protect-uploads-main-container">
|
12 |
<form method="POST" enctype="multipart/form-data">
|
13 |
|
14 |
+
<?php wp_nonce_field( 'submit_form', 'protect-uploads'. '_nonce' ); ?>
|
15 |
+
|
16 |
<table class="form-table">
|
17 |
<tbody>
|
18 |
<tr>
|
44 |
<!-- -->
|
45 |
<label for="protection_1">
|
46 |
<input type="radio" value="index_php" name="protection" id="protection_1" <?php if( get_option( $this->plugin_name . '-protection') == 'index_php' ) { ?>checked<?php } ?>>
|
47 |
+
<strong><?php _e('add index file', $this->plugin_name); ?></strong>
|
48 |
<p class="description"><?php _e('This will create an index.php file on the root of your uploads directory. This simple trick will hide the content of your whole uploads directory.', $this->plugin_name); ?></p>
|
49 |
</label><br>
|
50 |
<!-- -->
|
51 |
<label for="protection_2">
|
52 |
<input type="radio" value="htaccess" name="protection" id="protection_2" <?php if( get_option( $this->plugin_name . '-protection') == 'htaccess' ) { ?>checked<?php } ?>>
|
53 |
+
<strong><?php _e('prevent directory listing with htaccess', $this->plugin_name); ?></strong>
|
54 |
<p class="description"><?php _e('Through the htaccess file, it will prevent people to browse your uploads directory and return a 403 code (Forbidden Access).', $this->plugin_name); ?></p>
|
55 |
</label><br>
|
56 |
<!-- -->
|
60 |
<p class="description"><?php _e('Your uploads directory is not protected.', $this->plugin_name); ?></p>
|
61 |
</label><br>
|
62 |
</fieldset>
|
63 |
+
|
64 |
</td>
|
65 |
</tr>
|
66 |
<tr>
|
92 |
</table>
|
93 |
|
94 |
</form>
|
95 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
96 |
</div>
|
97 |
+
|
98 |
+
<?php require_once dirname( __FILE__ ) . '/includes/protect-uploads-admin-sidebar.php'; ?>
|
99 |
+
|
100 |
</div>
|
101 |
|
languages/protect-uploads-it_IT.mo
ADDED
Binary file
|
languages/protect-uploads-it_IT.po
ADDED
@@ -0,0 +1,197 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
msgid ""
|
2 |
+
msgstr ""
|
3 |
+
"Project-Id-Version: protect-uploads\n"
|
4 |
+
"POT-Creation-Date: 2015-04-01 15:38-0500\n"
|
5 |
+
"PO-Revision-Date: 2017-04-23 09:13+0100\n"
|
6 |
+
"Last-Translator: alticreation <alexis@alticreation.com>\n"
|
7 |
+
"Language-Team: Marko97 <concas.marco997@gmail.com>\n"
|
8 |
+
"Language: it_IT\n"
|
9 |
+
"MIME-Version: 1.0\n"
|
10 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
+
"Content-Transfer-Encoding: 8bit\n"
|
12 |
+
"X-Generator: Poedit 1.7.7\n"
|
13 |
+
"X-Poedit-Basepath: ../\n"
|
14 |
+
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
15 |
+
"X-Poedit-KeywordsList: _;__;_e\n"
|
16 |
+
"X-Poedit-SourceCharset: UTF-8\n"
|
17 |
+
"X-Poedit-SearchPath-0: .\n"
|
18 |
+
|
19 |
+
#: admin/class-protect-uploads-admin.php:56
|
20 |
+
msgid "Settings"
|
21 |
+
msgstr "Impostazioni"
|
22 |
+
|
23 |
+
#: admin/class-protect-uploads-admin.php:122
|
24 |
+
msgid "Impossible to create or modified the index.php file in "
|
25 |
+
msgstr "Impossibile creare o modificare il file index.php in"
|
26 |
+
|
27 |
+
#: admin/class-protect-uploads-admin.php:136
|
28 |
+
msgid ""
|
29 |
+
"The index.php file has been created in main folder and subfolders (two "
|
30 |
+
"levels max)."
|
31 |
+
msgstr ""
|
32 |
+
"Il file index.php è stato creato nella cartella principale e nelle sotto "
|
33 |
+
"cartelle (massimo 2 livelli)"
|
34 |
+
|
35 |
+
#: admin/class-protect-uploads-admin.php:170
|
36 |
+
msgid "Impossible to create or modified the htaccess file."
|
37 |
+
msgstr "Impossibile creare o modificare il file .htaccess"
|
38 |
+
|
39 |
+
#: admin/class-protect-uploads-admin.php:179
|
40 |
+
msgid "The htaccess file has been created."
|
41 |
+
msgstr "Il file .htaccess è stato creato"
|
42 |
+
|
43 |
+
#: admin/class-protect-uploads-admin.php:191
|
44 |
+
msgid "Existing htaccess has been updated."
|
45 |
+
msgstr "Il file .htaccess è stato aggiornato"
|
46 |
+
|
47 |
+
#: admin/class-protect-uploads-admin.php:221
|
48 |
+
msgid "The index.php file(s) have(has) been deleted."
|
49 |
+
msgstr ""
|
50 |
+
"Il file index.php è stato eliminato / I file index.php sono stati eliminati"
|
51 |
+
|
52 |
+
#: admin/class-protect-uploads-admin.php:250
|
53 |
+
msgid "The htaccess file has been updated."
|
54 |
+
msgstr "Il file .htacess è stato aggiornato"
|
55 |
+
|
56 |
+
#: admin/class-protect-uploads-admin.php:294
|
57 |
+
msgid ""
|
58 |
+
"The Protect Uploads plugin cannot work without Apache. Yourself or your web "
|
59 |
+
"host has to activate this module."
|
60 |
+
msgstr ""
|
61 |
+
"Il plugin Protect Uploads non può funzionare senza Apache. Verifica il tuo "
|
62 |
+
"webserver e attiva questo modulo."
|
63 |
+
|
64 |
+
#: admin/views/includes/protect-uploads-admin-message.php:7
|
65 |
+
msgid "Error code"
|
66 |
+
msgstr "Codice errore"
|
67 |
+
|
68 |
+
#: admin/views/includes/protect-uploads-admin-message.php:7
|
69 |
+
msgid "Go to Protect Uploads documentation"
|
70 |
+
msgstr "Documentazione di Protect Uploads (in inglese)"
|
71 |
+
|
72 |
+
#: admin/views/protect-uploads-admin-settings-page.php:9
|
73 |
+
msgid "by"
|
74 |
+
msgstr "da"
|
75 |
+
|
76 |
+
#: admin/views/protect-uploads-admin-settings-page.php:10
|
77 |
+
msgid ""
|
78 |
+
"Prevent users to browse your uploads directory. You'll protect your uploads "
|
79 |
+
"directory to be accessed and content stolen too easily in one batch."
|
80 |
+
msgstr ""
|
81 |
+
"Inibisci la possibilità agli utenti di navigare nella directory upload. "
|
82 |
+
"Questo consente di proteggerti da eventuali furti e impedire l'esecuzione di "
|
83 |
+
"batch a questo scopo."
|
84 |
+
|
85 |
+
#: admin/views/protect-uploads-admin-settings-page.php:17
|
86 |
+
msgid "Status"
|
87 |
+
msgstr "Stato"
|
88 |
+
|
89 |
+
#: admin/views/protect-uploads-admin-settings-page.php:22
|
90 |
+
msgid "Uploads directory is protected."
|
91 |
+
msgstr "La directory upload è protetta"
|
92 |
+
|
93 |
+
#: admin/views/protect-uploads-admin-settings-page.php:24
|
94 |
+
msgid ""
|
95 |
+
"Your uploads directory is <strong>already protected</strong> by an htaccess "
|
96 |
+
"file or an Apache setting set for the whole website. You don't need extra "
|
97 |
+
"protection.<br>The «remove option» behind will have no effect on the current "
|
98 |
+
"protection."
|
99 |
+
msgstr ""
|
100 |
+
"La directory upload è <strong>già protetta</strong> da un file .htaccess o "
|
101 |
+
"una configurazione Apache. Non necessiti di ulteriore protezione."
|
102 |
+
"<br>L'opzione «rimuovi opzione» non avrà effetto sulla protezione attuale."
|
103 |
+
|
104 |
+
#: admin/views/protect-uploads-admin-settings-page.php:27
|
105 |
+
msgid "Uploads directory is not protected!"
|
106 |
+
msgstr "La directory upload non è protetta!"
|
107 |
+
|
108 |
+
#: admin/views/protect-uploads-admin-settings-page.php:34
|
109 |
+
#: admin/views/protect-uploads-admin-settings-page.php:39
|
110 |
+
msgid "Protection"
|
111 |
+
msgstr "Protezione"
|
112 |
+
|
113 |
+
#: admin/views/protect-uploads-admin-settings-page.php:44
|
114 |
+
msgid "add index file"
|
115 |
+
msgstr "Aggiungi file index"
|
116 |
+
|
117 |
+
#: admin/views/protect-uploads-admin-settings-page.php:45
|
118 |
+
msgid ""
|
119 |
+
"This will create an index.php file on the root of your uploads directory. "
|
120 |
+
"This simple trick will hide the content of your whole uploads directory."
|
121 |
+
msgstr ""
|
122 |
+
"Questa operazione creerà un file index.php vuoto nella directory upload. "
|
123 |
+
"Questo è un semplice trucchetto per nascondere il contenuto nella directory."
|
124 |
+
|
125 |
+
#: admin/views/protect-uploads-admin-settings-page.php:50
|
126 |
+
msgid "prevent directory listing with htaccess"
|
127 |
+
msgstr "Inserisci protezione tramite .htaccess"
|
128 |
+
|
129 |
+
#: admin/views/protect-uploads-admin-settings-page.php:51
|
130 |
+
msgid ""
|
131 |
+
"Through the htaccess file, it will prevent people to browse your uploads "
|
132 |
+
"directory and return a 403 code (Forbidden Access)."
|
133 |
+
msgstr ""
|
134 |
+
"Tramite il file .htaccess, questo bloccherà l'accesso alle risorse presenti "
|
135 |
+
"nella directory mostrando il codice errore 403 (accesso negato)."
|
136 |
+
|
137 |
+
#: admin/views/protect-uploads-admin-settings-page.php:56
|
138 |
+
msgid "remove protection or disabled protection"
|
139 |
+
msgstr "Disattiva protezione"
|
140 |
+
|
141 |
+
#: admin/views/protect-uploads-admin-settings-page.php:57
|
142 |
+
msgid "Your uploads directory is not protected."
|
143 |
+
msgstr ""
|
144 |
+
"Questa operazione disabiliterà la protezione. Eventuali altre protezioni non "
|
145 |
+
"verranno disabilitate."
|
146 |
+
|
147 |
+
#: admin/views/protect-uploads-admin-settings-page.php:65
|
148 |
+
msgid "Check"
|
149 |
+
msgstr "Verifica"
|
150 |
+
|
151 |
+
#: admin/views/protect-uploads-admin-settings-page.php:68
|
152 |
+
msgid "Visit your"
|
153 |
+
msgstr "Visita"
|
154 |
+
|
155 |
+
#: admin/views/protect-uploads-admin-settings-page.php:68
|
156 |
+
msgid "uploads directory"
|
157 |
+
msgstr "la directory upload"
|
158 |
+
|
159 |
+
#: admin/views/protect-uploads-admin-settings-page.php:68
|
160 |
+
msgid "to check the current protection"
|
161 |
+
msgstr "per verificare la protezione attuale"
|
162 |
+
|
163 |
+
#: admin/views/protect-uploads-admin-settings-page.php:73
|
164 |
+
msgid "Support"
|
165 |
+
msgstr "Supporto"
|
166 |
+
|
167 |
+
#: admin/views/protect-uploads-admin-settings-page.php:76
|
168 |
+
msgid ""
|
169 |
+
"Protect Uploads Plugin <a href=\"http://www.alticreation.com/en/protect-"
|
170 |
+
"uploads/\" target=\"_blank\">support page</a>."
|
171 |
+
msgstr ""
|
172 |
+
"Vedi la nostra <a href=\"http://www.alticreation.com/en/protect-uploads/\" "
|
173 |
+
"target=\"_blank\">pagina</a> di supporto del plugin. (in inglese)"
|
174 |
+
|
175 |
+
#: admin/views/protect-uploads-admin-settings-page.php:77
|
176 |
+
msgid ""
|
177 |
+
"This plugin is compatible with the <span class=\"dashicons dashicons-awards"
|
178 |
+
"\"></span> <a href=\"http://www.alticreation.com/en/alti-watermark/\" target="
|
179 |
+
"\"_blank\">Watermark Plugin</a>."
|
180 |
+
msgstr ""
|
181 |
+
"Questo plugin è compatibile con <span class=\"dashicons dashicons-awards\"></"
|
182 |
+
"span> <a href=\"http://www.alticreation.com/en/alti-watermark/\" target="
|
183 |
+
"\"_blank\">Watermark Plugin</a>."
|
184 |
+
|
185 |
+
#: admin/views/protect-uploads-admin-settings-page.php:78
|
186 |
+
msgid ""
|
187 |
+
"To do so, you have to: 1. Install the Watermark Plugin 2. Then choose your "
|
188 |
+
"settings in this page and Update."
|
189 |
+
msgstr " "
|
190 |
+
|
191 |
+
#: admin/views/protect-uploads-admin-settings-page.php:85
|
192 |
+
msgid "Update"
|
193 |
+
msgstr "Salva le modifiche"
|
194 |
+
|
195 |
+
#: admin/views/protect-uploads-admin-settings-page.php:94
|
196 |
+
msgid "Protect Uploads plugin is developped by"
|
197 |
+
msgstr "Questo plugin è stato sviluppato da"
|
protect-uploads.php
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
-
<?php
|
2 |
/**
|
3 |
* Plugin Name: Protect Uploads
|
4 |
* Plugin URI: http://www.alticreation.com/en/protect-uploads/
|
5 |
* Description: Protect your uploads directory. Avoid browsing of your uploads directory by adding a htaccess file or an index.php file.
|
6 |
-
* Version: 0.
|
7 |
* Author: Alexis Blondin
|
8 |
* Author URI: http://www.alticreation.com
|
9 |
* License: GPL-2.0+
|
1 |
+
<?php
|
2 |
/**
|
3 |
* Plugin Name: Protect Uploads
|
4 |
* Plugin URI: http://www.alticreation.com/en/protect-uploads/
|
5 |
* Description: Protect your uploads directory. Avoid browsing of your uploads directory by adding a htaccess file or an index.php file.
|
6 |
+
* Version: 0.2
|
7 |
* Author: Alexis Blondin
|
8 |
* Author URI: http://www.alticreation.com
|
9 |
* License: GPL-2.0+
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: alticreation
|
|
3 |
Donate link: http://www.alticreation.com/en/protect-uploads/
|
4 |
Tags: uploads, protection, images protection, browsing images, uploads folder, image folder, avoid browsing folder, hide uploads, prevent uploads browsing, prevent images browsing, protect library, library
|
5 |
Requires at least: 3.0.1
|
6 |
-
Tested up to: 4.
|
7 |
-
Stable tag: 0.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -21,6 +21,7 @@ Available languages :
|
|
21 |
* English
|
22 |
* Français
|
23 |
* Español
|
|
|
24 |
|
25 |
For support, please visit [protect uploads plugin](http://www.alticreation.com/en/protect-uploads/ "protect uploads plugin for Wordpress by alticreation")
|
26 |
|
@@ -48,3 +49,9 @@ Nothing for now
|
|
48 |
|
49 |
= 0.1 =
|
50 |
* Initial release
|
|
|
|
|
|
|
|
|
|
|
|
3 |
Donate link: http://www.alticreation.com/en/protect-uploads/
|
4 |
Tags: uploads, protection, images protection, browsing images, uploads folder, image folder, avoid browsing folder, hide uploads, prevent uploads browsing, prevent images browsing, protect library, library
|
5 |
Requires at least: 3.0.1
|
6 |
+
Tested up to: 4.7.4
|
7 |
+
Stable tag: 0.2
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
21 |
* English
|
22 |
* Français
|
23 |
* Español
|
24 |
+
* Italian (thanks to Marko97)
|
25 |
|
26 |
For support, please visit [protect uploads plugin](http://www.alticreation.com/en/protect-uploads/ "protect uploads plugin for Wordpress by alticreation")
|
27 |
|
49 |
|
50 |
= 0.1 =
|
51 |
* Initial release
|
52 |
+
|
53 |
+
= 0.2 =
|
54 |
+
* Add security check to form in admin page.
|
55 |
+
* Add sidebar for admin page
|
56 |
+
* Add Italian translation (thanks to Marko97).
|
57 |
+
* Try to fix the wrong message saying that Protection is disabled eventhough it is actually working.
|