Version Description
- Persian translation by Danial Hatami
- Fix saving a redirection by login status, referrer, and user agent
- Fix problem where deleting your last group would cause Redirection to only show an error
- Add limits to referrer and destination in the logs
- Redirect title now shows in the main list again. The field is hidden when editing until toggled
- Fix 'bad nonce' error, props to Jonathan Harrell
Download this release
Release Info
Developer | johnny5 |
Plugin | Redirection |
Version | 2.3.12 |
Comparing to | |
See all releases |
Code changes from version 2.3.11 to 2.3.12
- admin.css +49 -142
- locale/fa_IR.mo +0 -0
- locale/fa_IR.po +1073 -0
- matches/login.php +12 -10
- matches/referrer.php +8 -6
- matches/url.php +1 -1
- matches/user_agent.php +9 -7
- models/group.php +1 -1
- models/htaccess.php +4 -4
- models/pager.php +12 -6
- modules/wordpress.php +5 -14
- plugin.php +0 -515
- readme.txt +15 -3
- js/redirection.js → redirection.js +8 -1
- redirection.php +83 -40
- view/admin/add.php +1 -1
- view/admin/group_edit.php +2 -2
- view/admin/group_list.php +1 -1
- view/admin/item_edit.php +10 -9
- view/admin/item_list.php +2 -2
- view/admin/log.php +2 -2
- view/admin/module_edit.php +1 -1
- view/admin/module_list.php +1 -1
- view/admin/options.php +1 -1
- view/admin/support.php +1 -1
admin.css
CHANGED
@@ -1,122 +1,64 @@
|
|
1 |
-
.
|
2 |
-
|
3 |
-
width: 100%;
|
4 |
-
border-spacing: 0px 5px;
|
5 |
-
}
|
6 |
-
|
7 |
-
.modules img
|
8 |
-
{
|
9 |
-
vertical-align: middle;
|
10 |
-
}
|
11 |
-
|
12 |
-
.modules a
|
13 |
-
{
|
14 |
-
border: none;
|
15 |
-
text-decoration: underline;
|
16 |
-
}
|
17 |
-
|
18 |
-
.modules td
|
19 |
-
{
|
20 |
-
padding: 6px;
|
21 |
-
background-color: #e6e6e6;
|
22 |
-
}
|
23 |
-
|
24 |
-
.modules th
|
25 |
-
{
|
26 |
-
padding: 0px 6px;
|
27 |
-
}
|
28 |
-
|
29 |
-
.modules td p
|
30 |
-
{
|
31 |
-
margin: 0 0 0.5em 0;
|
32 |
-
}
|
33 |
-
|
34 |
-
.modules td h4
|
35 |
-
{
|
36 |
-
margin: 0 0 0.5em 0;
|
37 |
-
font-size: 1.2em;
|
38 |
-
}
|
39 |
-
|
40 |
-
.modules td strong
|
41 |
-
{
|
42 |
-
color: red;
|
43 |
-
}
|
44 |
-
|
45 |
-
.modules td.logo
|
46 |
-
{
|
47 |
-
background-color: #d4d4d4;
|
48 |
-
width: 70px;
|
49 |
-
text-align: center;
|
50 |
-
}
|
51 |
-
|
52 |
-
.modules td.operations
|
53 |
-
{
|
54 |
-
background-color: #d4d4d4;
|
55 |
-
text-align: center;
|
56 |
-
}
|
57 |
-
|
58 |
-
.modules td table td
|
59 |
-
{
|
60 |
-
padding: 0px;
|
61 |
}
|
62 |
|
63 |
-
.
|
64 |
-
|
65 |
-
|
66 |
}
|
67 |
|
68 |
-
.
|
69 |
-
|
70 |
-
margin-top: 7px;
|
71 |
-
font-size: 0.8em;
|
72 |
-
background-color: #d4d4d4;
|
73 |
-
padding: 5px 10px 4px 10px;
|
74 |
}
|
75 |
|
76 |
-
.
|
77 |
-
|
78 |
-
|
79 |
-
|
|
|
|
|
|
|
|
|
|
|
80 |
}
|
81 |
|
82 |
-
.
|
83 |
-
|
84 |
-
|
|
|
|
|
|
|
|
|
|
|
85 |
}
|
86 |
|
87 |
-
.
|
88 |
-
|
89 |
-
|
|
|
90 |
}
|
91 |
|
92 |
-
|
93 |
-
|
94 |
-
list-style-type: square;
|
95 |
-
margin-left: 20px;
|
96 |
}
|
97 |
|
98 |
-
.
|
99 |
-
|
100 |
-
list-style-type: none;
|
101 |
-
float: left;
|
102 |
-
text-align: center;
|
103 |
-
padding: 1em 2em;
|
104 |
}
|
105 |
|
106 |
-
.
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
margin-left: 1.5em;
|
111 |
}
|
112 |
|
113 |
-
|
114 |
-
|
115 |
-
background-color: yellow;
|
116 |
}
|
117 |
|
118 |
-
|
119 |
-
|
|
|
120 |
}
|
121 |
|
122 |
.wp-list-table .column-moduletype {
|
@@ -155,54 +97,19 @@ direction:ltr;
|
|
155 |
text-align: left;
|
156 |
}
|
157 |
|
158 |
-
table.
|
159 |
-
float: left;
|
160 |
-
display: block;
|
161 |
-
}
|
162 |
-
|
163 |
-
table.edit.loading .table-actions {
|
164 |
-
display: none;
|
165 |
-
}
|
166 |
-
|
167 |
-
table.items .red-disabled {
|
168 |
-
text-decoration: line-through;
|
169 |
-
}
|
170 |
-
|
171 |
-
table.edit {
|
172 |
width: 100%;
|
173 |
}
|
174 |
|
175 |
-
.
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
.red-error {
|
180 |
-
display: none;
|
181 |
-
border-width: 1px;
|
182 |
-
border-style: solid;
|
183 |
-
padding: 1em 1em;
|
184 |
-
margin: 10px 0px;
|
185 |
-
background-color: #F55B7C;
|
186 |
-
border-color: red;
|
187 |
-
color: white;
|
188 |
}
|
189 |
|
190 |
-
.
|
191 |
-
|
192 |
-
|
193 |
-
border-style: solid;
|
194 |
-
padding: 0 0.6em;
|
195 |
-
margin: 5px 15px 2px;
|
196 |
-
background-color: #ffffe0;
|
197 |
-
border-color: #e6db55;
|
198 |
}
|
199 |
|
200 |
-
.loading .updated-red p {
|
201 |
-
margin: 0.5em 0;
|
202 |
-
line-height: 1;
|
203 |
-
padding: 2px;
|
204 |
-
}
|
205 |
|
206 |
-
.loaded-error .red-error {
|
207 |
-
display: block;
|
208 |
-
}
|
1 |
+
.red-added {
|
2 |
+
display: none;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
}
|
4 |
|
5 |
+
table.edit.loading .table-loading .spinner {
|
6 |
+
float: left;
|
7 |
+
display: block;
|
8 |
}
|
9 |
|
10 |
+
table.items .red-disabled {
|
11 |
+
text-decoration: line-through;
|
|
|
|
|
|
|
|
|
12 |
}
|
13 |
|
14 |
+
.red-error {
|
15 |
+
display: none;
|
16 |
+
border-width: 1px;
|
17 |
+
border-style: solid;
|
18 |
+
padding: 1em 1em;
|
19 |
+
margin: 10px 0px;
|
20 |
+
background-color: #F55B7C;
|
21 |
+
border-color: red;
|
22 |
+
color: white;
|
23 |
}
|
24 |
|
25 |
+
.loaded .red-added {
|
26 |
+
display: block;
|
27 |
+
border-width: 1px;
|
28 |
+
border-style: solid;
|
29 |
+
padding: 0 0.6em;
|
30 |
+
margin: 5px 15px 2px;
|
31 |
+
background-color: #ffffe0;
|
32 |
+
border-color: #e6db55;
|
33 |
}
|
34 |
|
35 |
+
.loading .updated-red p {
|
36 |
+
margin: 0.5em 0;
|
37 |
+
line-height: 1;
|
38 |
+
padding: 2px;
|
39 |
}
|
40 |
|
41 |
+
.loaded-error .red-error {
|
42 |
+
display: block;
|
|
|
|
|
43 |
}
|
44 |
|
45 |
+
.advanced {
|
46 |
+
display: none;
|
|
|
|
|
|
|
|
|
47 |
}
|
48 |
|
49 |
+
.advanced-toggle {
|
50 |
+
font-size: 26px;
|
51 |
+
margin-left: 15px;
|
52 |
+
vertical-align: sub;
|
|
|
53 |
}
|
54 |
|
55 |
+
.advanced-toggled {
|
56 |
+
color: #aaa !important;
|
|
|
57 |
}
|
58 |
|
59 |
+
.advanced-toggle:focus {
|
60 |
+
box-shadow: none;
|
61 |
+
-webkit-box-shadow: none;
|
62 |
}
|
63 |
|
64 |
.wp-list-table .column-moduletype {
|
97 |
text-align: left;
|
98 |
}
|
99 |
|
100 |
+
table.items table.edit {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
101 |
width: 100%;
|
102 |
}
|
103 |
|
104 |
+
table.items table.edit td, table.items table.edit th {
|
105 |
+
line-height: 1.2;
|
106 |
+
padding: 2px;
|
107 |
+
font-size: 12px;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
108 |
}
|
109 |
|
110 |
+
table.items table.edit th {
|
111 |
+
font-size: 13px;
|
112 |
+
font-weight: bold;
|
|
|
|
|
|
|
|
|
|
|
113 |
}
|
114 |
|
|
|
|
|
|
|
|
|
|
|
115 |
|
|
|
|
|
|
locale/fa_IR.mo
ADDED
Binary file
|
locale/fa_IR.po
ADDED
@@ -0,0 +1,1073 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# SOME DESCRIPTIVE TITLE.
|
2 |
+
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
3 |
+
# This file is distributed under the same license as the PACKAGE package.
|
4 |
+
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
5 |
+
#
|
6 |
+
msgid ""
|
7 |
+
msgstr ""
|
8 |
+
"Project-Id-Version: Persian Redirection Plugin\n"
|
9 |
+
"Report-Msgid-Bugs-To: http://wordpress.org/tag/redirection\n"
|
10 |
+
"POT-Creation-Date: 2012-05-07 13:59:00+00:00\n"
|
11 |
+
"PO-Revision-Date: 2014-08-04 16:40+0330\n"
|
12 |
+
"Last-Translator: Danial Hatami <great.emperor94@gmail.com>\n"
|
13 |
+
"Language-Team: Danial Hatami <hi@chamrosh.ir>\n"
|
14 |
+
"Language: fa_IR\n"
|
15 |
+
"MIME-Version: 1.0\n"
|
16 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
17 |
+
"Content-Transfer-Encoding: 8bit\n"
|
18 |
+
"X-Poedit-SourceCharset: UTF-8\n"
|
19 |
+
"X-Poedit-KeywordsList: __;_e;__ ;_e\n"
|
20 |
+
"X-Poedit-Basepath: .\n"
|
21 |
+
"X-Generator: Poedit 1.6.5\n"
|
22 |
+
"Plural-Forms: nplurals=1; plural=0;\n"
|
23 |
+
|
24 |
+
#: ajax.php:370
|
25 |
+
msgid "Sorry, but your redirection was not created"
|
26 |
+
msgstr "متاسفیم ٬ اما تغییر مسیر شما ایجاد نشده است ."
|
27 |
+
|
28 |
+
#: fileio/csv.php:21
|
29 |
+
msgid "module_%d.csv"
|
30 |
+
msgstr "module_%d.csv"
|
31 |
+
|
32 |
+
#: fileio/xml.php:32
|
33 |
+
msgid "module_%d.xml"
|
34 |
+
msgstr "module_%d.xml"
|
35 |
+
|
36 |
+
#: fileio/xml.php:105
|
37 |
+
msgid "%s imported on %s at %s"
|
38 |
+
msgstr "%s درون ریزی شده در %s در %s"
|
39 |
+
|
40 |
+
#: fileio/xml.php:168
|
41 |
+
msgid "XML importing is only available with PHP5 - you have PHP4."
|
42 |
+
msgstr ""
|
43 |
+
"درون ریزی XML تنها در نسخه PHP5 امکان پذیر است و شما از نسخه PHP4 استفاده "
|
44 |
+
"میکنید."
|
45 |
+
|
46 |
+
#: matches/login.php:25
|
47 |
+
msgid "URL and login status"
|
48 |
+
msgstr "نشانی و وضعیت ورودی"
|
49 |
+
|
50 |
+
#: matches/login.php:33
|
51 |
+
msgid ""
|
52 |
+
"The target URL will be chosen from one of the following URLs, depending if "
|
53 |
+
"the user is logged in or out. Leaving a URL blank means that the user is "
|
54 |
+
"not redirected."
|
55 |
+
msgstr ""
|
56 |
+
"نشانی هدف از یکی از نشانی های زیر انتخاب میشود و بستگی به این دارد که کاربر "
|
57 |
+
"وارد شده باشد یا خیر. خالی گذاشتن نشانی به معنای عدم تغییر مسیر کاربر است !"
|
58 |
+
|
59 |
+
#: matches/login.php:39 matches/login.php:41
|
60 |
+
msgid "Logged In"
|
61 |
+
msgstr "وارد شده"
|
62 |
+
|
63 |
+
#: matches/login.php:51 matches/login.php:53
|
64 |
+
msgid "Logged Out"
|
65 |
+
msgstr "خارج شده"
|
66 |
+
|
67 |
+
#: matches/referrer.php:28
|
68 |
+
msgid "URL and referrer"
|
69 |
+
msgstr "نشانی و ارجاع دهنده"
|
70 |
+
|
71 |
+
#: matches/referrer.php:40 view/admin/log.php:69
|
72 |
+
msgid "Referrer"
|
73 |
+
msgstr "مرجع"
|
74 |
+
|
75 |
+
#: matches/referrer.php:43 view/admin/item_edit.php:18
|
76 |
+
msgid "Regex"
|
77 |
+
msgstr "عبارت منظم"
|
78 |
+
|
79 |
+
#: matches/referrer.php:47 matches/url.php:40 matches/user_agent.php:57
|
80 |
+
msgid "HTTP Code"
|
81 |
+
msgstr "کد HTTP"
|
82 |
+
|
83 |
+
#: matches/referrer.php:57
|
84 |
+
msgid ""
|
85 |
+
"The visitor will be redirected from the source URL if the referrer matches. "
|
86 |
+
"You can specify a <em>matched</em> target URL as the address to send "
|
87 |
+
"visitors if they do match, and <em>not matched</em> if they don't match. "
|
88 |
+
"Leaving a URL blank means that the visitor is not redirected."
|
89 |
+
msgstr ""
|
90 |
+
"بازدید کننده در صورت تطابق نشانی منبع تغییر مسیر داده میشود شما میتوانید یک "
|
91 |
+
"نشانی هدف برای تطابق یا عدم تطابق برای بازدیدکننده تعیین کنید و در صورت خالی "
|
92 |
+
"بودن نشانی بازدیدکننده تغییر مسیر نمیدهد."
|
93 |
+
|
94 |
+
#: matches/referrer.php:63 matches/referrer.php:65 matches/user_agent.php:75
|
95 |
+
#: matches/user_agent.php:77
|
96 |
+
msgid "Matched"
|
97 |
+
msgstr "همسان"
|
98 |
+
|
99 |
+
#: matches/referrer.php:73 matches/referrer.php:75 matches/user_agent.php:85
|
100 |
+
#: matches/user_agent.php:87
|
101 |
+
msgid "Not matched"
|
102 |
+
msgstr "عدم تطابق"
|
103 |
+
|
104 |
+
#: matches/url.php:25
|
105 |
+
msgid "URL only"
|
106 |
+
msgstr "فقط نشانی"
|
107 |
+
|
108 |
+
#: matches/url.php:32 view/admin/add.php:31
|
109 |
+
msgid "Target URL"
|
110 |
+
msgstr "URL هدف"
|
111 |
+
|
112 |
+
#: matches/user_agent.php:27
|
113 |
+
msgid "URL and user agent"
|
114 |
+
msgstr "نشانی و عامل کاربری"
|
115 |
+
|
116 |
+
#: matches/user_agent.php:32
|
117 |
+
msgid "FeedBurner"
|
118 |
+
msgstr "فید برنر"
|
119 |
+
|
120 |
+
#: matches/user_agent.php:33
|
121 |
+
msgid "Internet Explorer"
|
122 |
+
msgstr "اینترنت اکسپلورر"
|
123 |
+
|
124 |
+
#: matches/user_agent.php:34
|
125 |
+
msgid "FireFox"
|
126 |
+
msgstr "فایرفاکس"
|
127 |
+
|
128 |
+
#: matches/user_agent.php:35
|
129 |
+
msgid "Opera"
|
130 |
+
msgstr "اپرا"
|
131 |
+
|
132 |
+
#: matches/user_agent.php:36
|
133 |
+
msgid "Safari"
|
134 |
+
msgstr "سفری"
|
135 |
+
|
136 |
+
#: matches/user_agent.php:37
|
137 |
+
msgid "iPhone"
|
138 |
+
msgstr "آیفون"
|
139 |
+
|
140 |
+
#: matches/user_agent.php:38
|
141 |
+
msgid "iPad"
|
142 |
+
msgstr "آیپاد"
|
143 |
+
|
144 |
+
#: matches/user_agent.php:39
|
145 |
+
msgid "Android"
|
146 |
+
msgstr "آندروید"
|
147 |
+
|
148 |
+
#: matches/user_agent.php:40
|
149 |
+
msgid "Nintendo Wii"
|
150 |
+
msgstr "نینتندو"
|
151 |
+
|
152 |
+
#: matches/user_agent.php:45 view/admin/log_item_details.php:20
|
153 |
+
msgid "User Agent"
|
154 |
+
msgstr "User Agent"
|
155 |
+
|
156 |
+
#: matches/user_agent.php:68
|
157 |
+
msgid ""
|
158 |
+
"The visitor will be redirected from the source URL if the user agent "
|
159 |
+
"matches. You can specify a <em>matched</em> target URL as the address to "
|
160 |
+
"send visitors if they do match, and <em>not matched</em> if they don't "
|
161 |
+
"match. Leaving a URL blank means that the visitor is not redirected. "
|
162 |
+
"<strong>All matches are performed as regular expressions</strong>.\n"
|
163 |
+
msgstr ""
|
164 |
+
"بازدید کننده در صورت تطابق عامل کاربری تغییر مسیر داده میشود شما میتوانید یک "
|
165 |
+
"نشانی هدف برای تطابق یا عدم تطابق برای بازدیدکننده تعیین کنید و در صورت خالی "
|
166 |
+
"بودن نشانی بازدیدکننده تغییر مسیر نمیدهد. تمام مطابقها به عنوان عبارت های "
|
167 |
+
"منظم انجام میشوند .\n"
|
168 |
+
|
169 |
+
#: models/database.php:94 models/module.php:161
|
170 |
+
msgid "WordPress"
|
171 |
+
msgstr "وردپرس"
|
172 |
+
|
173 |
+
#: models/database.php:95 models/module.php:160 view/admin/module_item.php:27
|
174 |
+
msgid "Apache"
|
175 |
+
msgstr "آپاچی"
|
176 |
+
|
177 |
+
#: models/database.php:96
|
178 |
+
msgid "404"
|
179 |
+
msgstr "۴۰۴"
|
180 |
+
|
181 |
+
#: models/database.php:101
|
182 |
+
msgid "Redirections"
|
183 |
+
msgstr "تغییر مسیرها"
|
184 |
+
|
185 |
+
#: models/database.php:102
|
186 |
+
msgid "Modified Posts"
|
187 |
+
msgstr "نوشتههای اصلاحیافته"
|
188 |
+
|
189 |
+
#: models/group.php:194
|
190 |
+
msgid "Yes"
|
191 |
+
msgstr "بله"
|
192 |
+
|
193 |
+
#: models/group.php:195
|
194 |
+
msgid "No"
|
195 |
+
msgstr "خیر"
|
196 |
+
|
197 |
+
#: models/module.php:162
|
198 |
+
msgid "404 Errors"
|
199 |
+
msgstr "خطاهای ۴۰۴"
|
200 |
+
|
201 |
+
#: models/module.php:187
|
202 |
+
msgid "Strip WWW"
|
203 |
+
msgstr "حذف www"
|
204 |
+
|
205 |
+
#: models/module.php:187
|
206 |
+
msgid "Force WWW"
|
207 |
+
msgstr "اعمال www"
|
208 |
+
|
209 |
+
#: models/module.php:192
|
210 |
+
msgid "Strip index.php"
|
211 |
+
msgstr "برهنهسازی index.php"
|
212 |
+
|
213 |
+
#: models/pager.php:389
|
214 |
+
msgid "Previous"
|
215 |
+
msgstr "قبلی"
|
216 |
+
|
217 |
+
#: models/pager.php:390
|
218 |
+
msgid "Next"
|
219 |
+
msgstr "بعدی"
|
220 |
+
|
221 |
+
#: models/pager.php:448
|
222 |
+
msgid "%d per-page"
|
223 |
+
msgstr "%d در هر برگه"
|
224 |
+
|
225 |
+
#: models/pager.php:457
|
226 |
+
msgid "Displaying %s–%s of %s"
|
227 |
+
msgstr "نمایش %s–%s از %s"
|
228 |
+
|
229 |
+
#: models/redirect.php:386
|
230 |
+
msgid "Redirect to URL"
|
231 |
+
msgstr "تغییر مسیر نشانیها"
|
232 |
+
|
233 |
+
#: models/redirect.php:387
|
234 |
+
msgid "Redirect to random post"
|
235 |
+
msgstr "تغییر مسیر به نوشتههای تصادفی"
|
236 |
+
|
237 |
+
#: models/redirect.php:388
|
238 |
+
msgid "Pass-through"
|
239 |
+
msgstr "Pass-through"
|
240 |
+
|
241 |
+
#: models/redirect.php:389
|
242 |
+
msgid "Error (404)"
|
243 |
+
msgstr "خطای ۴۰۴"
|
244 |
+
|
245 |
+
#: models/redirect.php:390
|
246 |
+
msgid "Do nothing"
|
247 |
+
msgstr "هیچکاری انجام نده"
|
248 |
+
|
249 |
+
#: modules/404.php:37
|
250 |
+
msgid "Log 404s"
|
251 |
+
msgstr "گزارشهای ۴۰۴"
|
252 |
+
|
253 |
+
#: modules/404.php:46 modules/wordpress.php:121
|
254 |
+
msgid ""
|
255 |
+
"<strong>Disabled: You must enable <a href=\"options-permalink.php"
|
256 |
+
"\">permalinks</a> before using this</strong>"
|
257 |
+
msgstr ""
|
258 |
+
"<strong>غیر فعال : شما باید نخست <a href=\"options-permalink.php\">پیوندهای "
|
259 |
+
"یکتا</a>را فعال کنید</strong>"
|
260 |
+
|
261 |
+
#: modules/404.php:57
|
262 |
+
msgid "<small>No options have been set</small>"
|
263 |
+
msgstr "<small>تنظیمات قرارداده نشده</small>"
|
264 |
+
|
265 |
+
#: modules/apache.php:77
|
266 |
+
msgid "Location"
|
267 |
+
msgstr "محل"
|
268 |
+
|
269 |
+
#: modules/apache.php:82
|
270 |
+
msgid "WordPress is installed in: <code>%s</code>"
|
271 |
+
msgstr "وردپرس در شاخه <code>%s</code> نصب شده"
|
272 |
+
|
273 |
+
#: modules/apache.php:87
|
274 |
+
msgid "Canonical"
|
275 |
+
msgstr "استاندارد"
|
276 |
+
|
277 |
+
#: modules/apache.php:90 modules/apache.php:96
|
278 |
+
msgid "Leave as is"
|
279 |
+
msgstr "ترک کردن به عنوان"
|
280 |
+
|
281 |
+
#: modules/apache.php:90
|
282 |
+
msgid "Strip WWW (%s)"
|
283 |
+
msgstr "حذف WWW (%s)"
|
284 |
+
|
285 |
+
#: modules/apache.php:90
|
286 |
+
msgid "Force WWW (www.%s)"
|
287 |
+
msgstr "اعمال WWW (www.%s)"
|
288 |
+
|
289 |
+
#: modules/apache.php:94
|
290 |
+
msgid "Strip Index"
|
291 |
+
msgstr "برهنه کردن صفحه اصلی"
|
292 |
+
|
293 |
+
#: modules/apache.php:96
|
294 |
+
msgid "Strip index files (html,php)"
|
295 |
+
msgstr "حذف پیشوند فایل اصلی (html,php)"
|
296 |
+
|
297 |
+
#: modules/apache.php:101
|
298 |
+
msgid "Memory Limit"
|
299 |
+
msgstr "محدودیت حافظه"
|
300 |
+
|
301 |
+
#: modules/apache.php:104 modules/apache.php:109
|
302 |
+
msgid "Server default"
|
303 |
+
msgstr "سرور پیشفرض"
|
304 |
+
|
305 |
+
#: modules/apache.php:107
|
306 |
+
msgid "Error Level"
|
307 |
+
msgstr "خطای دسترسی"
|
308 |
+
|
309 |
+
#: modules/apache.php:109
|
310 |
+
msgid "No errors"
|
311 |
+
msgstr "بدون خطا"
|
312 |
+
|
313 |
+
#: modules/apache.php:109
|
314 |
+
msgid "Show errors"
|
315 |
+
msgstr "نمایش خطاها"
|
316 |
+
|
317 |
+
#: modules/apache.php:114
|
318 |
+
msgid "Ban IPs"
|
319 |
+
msgstr "آیپیهای مسدودشده"
|
320 |
+
|
321 |
+
#: modules/apache.php:120
|
322 |
+
msgid "Allow IPs"
|
323 |
+
msgstr "آیپیهای مجاز"
|
324 |
+
|
325 |
+
#: modules/apache.php:126
|
326 |
+
msgid "Raw .htaccess"
|
327 |
+
msgstr ".htaccess خام "
|
328 |
+
|
329 |
+
#: modules/apache.php:132
|
330 |
+
msgid "Site URL"
|
331 |
+
msgstr "نشانی سایت"
|
332 |
+
|
333 |
+
#: modules/apache.php:135
|
334 |
+
msgid "Advanced: For management of external sites"
|
335 |
+
msgstr "پیشرفته : برای مدیریت سایتهای اکسترنال/خارجی"
|
336 |
+
|
337 |
+
#: modules/apache.php:150
|
338 |
+
msgid "<strong>Location is invalid - check that path exists</strong>"
|
339 |
+
msgstr ""
|
340 |
+
"<strong>مکان نامعتبر است - از وجود داشتن مسیر اطمینان حاصل کنید</strong>"
|
341 |
+
|
342 |
+
#: modules/apache.php:156
|
343 |
+
msgid ""
|
344 |
+
"<strong>Could not write to configured <code>.htaccess</code> file - check "
|
345 |
+
"file permissions</strong>"
|
346 |
+
msgstr ""
|
347 |
+
"<strong>امکان دسترسی به <code>.htaccess</code> نیست -سطح دسترسی ها را بررسی "
|
348 |
+
"کنید</strong>"
|
349 |
+
|
350 |
+
#: modules/apache.php:163
|
351 |
+
msgid ""
|
352 |
+
"<strong>Disabled: enter the location of an <code>.htaccess</code> file for "
|
353 |
+
"this to be valid</strong>"
|
354 |
+
msgstr ""
|
355 |
+
"<strong>غیر فعال : مکان پرونده <code>.htaccess</code> را برای معتبرسازی وارد "
|
356 |
+
"کنید.</strong>"
|
357 |
+
|
358 |
+
#: modules/apache.php:168
|
359 |
+
msgid "strip WWW"
|
360 |
+
msgstr "بدون WWW"
|
361 |
+
|
362 |
+
#: modules/apache.php:168
|
363 |
+
msgid "force WWW"
|
364 |
+
msgstr "بدون WWW"
|
365 |
+
|
366 |
+
#: modules/apache.php:171
|
367 |
+
msgid "strip index"
|
368 |
+
msgstr "برهنه سازی صفحه اصلی"
|
369 |
+
|
370 |
+
#: modules/apache.php:174
|
371 |
+
msgid "memory limit at %dMB"
|
372 |
+
msgstr "میزان حافظه %d مگابایت"
|
373 |
+
|
374 |
+
#: modules/apache.php:177
|
375 |
+
msgid "no errors"
|
376 |
+
msgstr "بدون خطا"
|
377 |
+
|
378 |
+
#: modules/apache.php:177
|
379 |
+
msgid "show errors"
|
380 |
+
msgstr "نمایش خطاها"
|
381 |
+
|
382 |
+
#: modules/apache.php:180
|
383 |
+
msgid "IPs are banned"
|
384 |
+
msgstr "آیپی ها مسدود شدند"
|
385 |
+
|
386 |
+
#: modules/apache.php:183
|
387 |
+
msgid "IPs are allowed"
|
388 |
+
msgstr "آیپیهای مجاز شده"
|
389 |
+
|
390 |
+
#: redirection.php:94
|
391 |
+
msgid "Settings"
|
392 |
+
msgstr "تنظیمات"
|
393 |
+
|
394 |
+
#: redirection.php:112
|
395 |
+
msgid "Please wait..."
|
396 |
+
msgstr "لطفا صبور باشید .."
|
397 |
+
|
398 |
+
#: redirection.php:115 view/admin/group_list.php:118
|
399 |
+
#: view/admin/item_list.php:113 view/admin/log.php:113
|
400 |
+
msgid "Are you sure?"
|
401 |
+
msgstr "هل انت متأكد؟"
|
402 |
+
|
403 |
+
#: redirection.php:116 view/admin/group_list.php:117
|
404 |
+
#: view/admin/item_list.php:112 view/admin/log.php:112
|
405 |
+
msgid "No items have been selected"
|
406 |
+
msgstr "موردی انتخاب نشده"
|
407 |
+
|
408 |
+
#. Plugin Name of the plugin/theme
|
409 |
+
#: redirection.php:121
|
410 |
+
msgid "Redirection"
|
411 |
+
msgstr "تغییر مسیر"
|
412 |
+
|
413 |
+
#: redirection.php:159
|
414 |
+
msgid "Your module was successfully created"
|
415 |
+
msgstr "ماژول با موفقیت ساخته شد"
|
416 |
+
|
417 |
+
#: redirection.php:163
|
418 |
+
msgid "Your module was not created - did you provide a name?"
|
419 |
+
msgstr "ماژول ایجاد نشد ! آیا اسمی گزینش کردید ؟"
|
420 |
+
|
421 |
+
#: redirection.php:228
|
422 |
+
msgid "Your options were updated"
|
423 |
+
msgstr "تنظیمات با موفقیت بهروز شد"
|
424 |
+
|
425 |
+
#: redirection.php:236
|
426 |
+
msgid "Redirection data has been deleted and the plugin disabled"
|
427 |
+
msgstr "اطلاعات پاک شد و افزونه غیر فعال !"
|
428 |
+
|
429 |
+
#: redirection.php:246
|
430 |
+
msgid "%d redirection was successfully imported"
|
431 |
+
msgid_plural "%d redirections were successfully imported"
|
432 |
+
msgstr[0] "%d تغییر مسیر با موفقیت درونریزی شد"
|
433 |
+
|
434 |
+
#: redirection.php:248
|
435 |
+
msgid "No items were imported"
|
436 |
+
msgstr "موردی درون ریزی نشد"
|
437 |
+
|
438 |
+
#: redirection.php:266
|
439 |
+
msgid "Your logs have been deleted"
|
440 |
+
msgstr "گزارشهای شما پاک شدند"
|
441 |
+
|
442 |
+
#: redirection.php:289
|
443 |
+
msgid "Your group was added successfully"
|
444 |
+
msgstr "گروه افزوده شد"
|
445 |
+
|
446 |
+
#: redirection.php:293
|
447 |
+
msgid "Please specify a group name"
|
448 |
+
msgstr "لطفا یک نام برای گروه انتخاب کنید"
|
449 |
+
|
450 |
+
#: redirection.php:330
|
451 |
+
msgid "Redirection is available in"
|
452 |
+
msgstr "تغییر مسیر در دسترس است در"
|
453 |
+
|
454 |
+
#: view/admin/add.php:3
|
455 |
+
msgid "Add new redirection"
|
456 |
+
msgstr "افزودن تغییر مسیر تازه"
|
457 |
+
|
458 |
+
#: view/admin/add.php:6
|
459 |
+
msgid "Your redirection has been added."
|
460 |
+
msgstr "تغییر مسیر شما افزوده شد."
|
461 |
+
|
462 |
+
#: view/admin/add.php:12 view/admin/item_edit.php:15 view/admin/log.php:68
|
463 |
+
#: view/admin/log_item_details.php:4
|
464 |
+
msgid "Source URL"
|
465 |
+
msgstr "نشانی اصلی"
|
466 |
+
|
467 |
+
#: view/admin/add.php:16
|
468 |
+
msgid "Match"
|
469 |
+
msgstr "تطابق"
|
470 |
+
|
471 |
+
#: view/admin/add.php:22
|
472 |
+
msgid "Action"
|
473 |
+
msgstr "فعالیت"
|
474 |
+
|
475 |
+
#: view/admin/add.php:27
|
476 |
+
msgid "Regular expression"
|
477 |
+
msgstr "عبارت منظم"
|
478 |
+
|
479 |
+
#: view/admin/add.php:36 view/admin/item_list.php:24 view/admin/log.php:43
|
480 |
+
msgid "Group"
|
481 |
+
msgstr "گروه"
|
482 |
+
|
483 |
+
#: view/admin/add.php:43
|
484 |
+
msgid "Add Redirection"
|
485 |
+
msgstr "افزودن"
|
486 |
+
|
487 |
+
#: view/admin/group_edit.php:6 view/admin/group_list.php:37
|
488 |
+
#: view/admin/group_list.php:100 view/admin/module_edit.php:18
|
489 |
+
#: view/admin/module_list.php:42
|
490 |
+
msgid "Name"
|
491 |
+
msgstr "نام"
|
492 |
+
|
493 |
+
#: view/admin/group_edit.php:10
|
494 |
+
msgid "Tracked"
|
495 |
+
msgstr "زنجیردار"
|
496 |
+
|
497 |
+
#: view/admin/group_edit.php:11
|
498 |
+
msgid "Whether to track 'hits' to items"
|
499 |
+
msgstr "ایا بازدیدها به موارد زنجیر شوند"
|
500 |
+
|
501 |
+
#: view/admin/group_edit.php:14
|
502 |
+
msgid "Enabled"
|
503 |
+
msgstr "فعالسازی"
|
504 |
+
|
505 |
+
#: view/admin/group_edit.php:15
|
506 |
+
msgid "Disabling a group will disable all items contained within it"
|
507 |
+
msgstr "غیرفعالسازی گروه سبب غیرفعال سازی تمامی موارد شامل شده در گروه میشود"
|
508 |
+
|
509 |
+
#: view/admin/group_edit.php:20 view/admin/item_edit.php:27
|
510 |
+
#: view/admin/module_edit.php:27
|
511 |
+
msgid "Save"
|
512 |
+
msgstr "دخیره سازی"
|
513 |
+
|
514 |
+
#: view/admin/group_edit.php:21 view/admin/item_edit.php:28
|
515 |
+
#: view/admin/module_edit.php:28
|
516 |
+
msgid "Cancel"
|
517 |
+
msgstr "الغي"
|
518 |
+
|
519 |
+
#: view/admin/group_item.php:3
|
520 |
+
msgid "edit group"
|
521 |
+
msgstr "ویرایش گروه"
|
522 |
+
|
523 |
+
#: view/admin/group_item.php:23 view/admin/item.php:27
|
524 |
+
msgid "disabled"
|
525 |
+
msgstr "غیرفعال شده"
|
526 |
+
|
527 |
+
#: view/admin/group_list.php:6
|
528 |
+
msgid "Groups for module"
|
529 |
+
msgstr "گروه های برای ماژول"
|
530 |
+
|
531 |
+
#: view/admin/group_list.php:16 view/admin/log.php:38
|
532 |
+
msgid "Module"
|
533 |
+
msgstr "ماژول"
|
534 |
+
|
535 |
+
#: view/admin/group_list.php:21 view/admin/item_list.php:29
|
536 |
+
#: view/admin/log.php:16 view/admin/log.php:23
|
537 |
+
msgid "Search"
|
538 |
+
msgstr "جستجو"
|
539 |
+
|
540 |
+
#: view/admin/group_list.php:26
|
541 |
+
msgid "go"
|
542 |
+
msgstr "برو"
|
543 |
+
|
544 |
+
#: view/admin/group_list.php:36 view/admin/item_list.php:42
|
545 |
+
#: view/admin/module_list.php:17
|
546 |
+
msgid "Hits"
|
547 |
+
msgstr "بازدیدها"
|
548 |
+
|
549 |
+
#: view/admin/group_list.php:59 view/admin/item_list.php:67
|
550 |
+
msgid "Select All"
|
551 |
+
msgstr "انتخاب همه"
|
552 |
+
|
553 |
+
#: view/admin/group_list.php:60 view/admin/item_list.php:68
|
554 |
+
msgid "Toggle"
|
555 |
+
msgstr "تغییر وضعیت"
|
556 |
+
|
557 |
+
#: view/admin/group_list.php:61 view/admin/item_list.php:69
|
558 |
+
msgid "Reset Hits"
|
559 |
+
msgstr "بازنشانی بازدیدها"
|
560 |
+
|
561 |
+
#: view/admin/group_list.php:62 view/admin/item_list.php:70
|
562 |
+
#: view/admin/log.php:30 view/admin/options.php:120
|
563 |
+
msgid "Delete"
|
564 |
+
msgstr "پاک کردن"
|
565 |
+
|
566 |
+
#: view/admin/group_list.php:64 view/admin/item_list.php:72
|
567 |
+
msgid "Move To"
|
568 |
+
msgstr "انتقال به"
|
569 |
+
|
570 |
+
#: view/admin/group_list.php:69 view/admin/item_list.php:34
|
571 |
+
#: view/admin/item_list.php:77
|
572 |
+
msgid "Go"
|
573 |
+
msgstr "برو"
|
574 |
+
|
575 |
+
#: view/admin/group_list.php:75 view/admin/item_list.php:83
|
576 |
+
msgid "re-order"
|
577 |
+
msgstr "چینش دوباره"
|
578 |
+
|
579 |
+
#: view/admin/group_list.php:76 view/admin/item_list.php:84
|
580 |
+
msgid "save order"
|
581 |
+
msgstr "ذخیرهسازی چینش"
|
582 |
+
|
583 |
+
#: view/admin/group_list.php:89
|
584 |
+
msgid "You have no groups in this module."
|
585 |
+
msgstr "شما گروهی در این ماژول ندارید ."
|
586 |
+
|
587 |
+
#: view/admin/group_list.php:94
|
588 |
+
msgid "Add Group"
|
589 |
+
msgstr "افزودن گروه"
|
590 |
+
|
591 |
+
#: view/admin/group_list.php:105
|
592 |
+
msgid "Add"
|
593 |
+
msgstr "افزودن"
|
594 |
+
|
595 |
+
#: view/admin/item_edit.php:3
|
596 |
+
msgid "%s by matching %s"
|
597 |
+
msgstr "%s تطابق با %s"
|
598 |
+
|
599 |
+
#: view/admin/item_edit.php:7
|
600 |
+
msgid "Title"
|
601 |
+
msgstr "عنوان"
|
602 |
+
|
603 |
+
#: view/admin/item_edit.php:10
|
604 |
+
msgid "optional"
|
605 |
+
msgstr "اختیاری"
|
606 |
+
|
607 |
+
#: view/admin/item_list.php:7
|
608 |
+
msgid "Redirections for group"
|
609 |
+
msgstr "تغییر مسیرها برای گروه"
|
610 |
+
|
611 |
+
#: view/admin/item_list.php:41
|
612 |
+
msgid "Last Access"
|
613 |
+
msgstr "آخرین دسترسی"
|
614 |
+
|
615 |
+
#: view/admin/item_list.php:43 view/admin/module_list.php:46
|
616 |
+
msgid "Type"
|
617 |
+
msgstr "نوع"
|
618 |
+
|
619 |
+
#: view/admin/item_list.php:44
|
620 |
+
msgid "URL"
|
621 |
+
msgstr "نشانی"
|
622 |
+
|
623 |
+
#: view/admin/item_list.php:44
|
624 |
+
msgid "Position"
|
625 |
+
msgstr "حالت"
|
626 |
+
|
627 |
+
#: view/admin/item_list.php:88
|
628 |
+
msgid "You have no redirections."
|
629 |
+
msgstr "تغییر مسیری ندارید"
|
630 |
+
|
631 |
+
#: view/admin/log.php:6
|
632 |
+
msgid "Redirection Log"
|
633 |
+
msgstr "گزارشهای تغییر مسیر"
|
634 |
+
|
635 |
+
#: view/admin/log.php:29
|
636 |
+
msgid "Bulk Actions"
|
637 |
+
msgstr "کارهای دسته جمعی"
|
638 |
+
|
639 |
+
#: view/admin/log.php:33
|
640 |
+
msgid "Apply"
|
641 |
+
msgstr "اعمال"
|
642 |
+
|
643 |
+
#: view/admin/log.php:49
|
644 |
+
msgid "Filter"
|
645 |
+
msgstr "صافی"
|
646 |
+
|
647 |
+
#: view/admin/log.php:67
|
648 |
+
msgid "Date"
|
649 |
+
msgstr "تاریح"
|
650 |
+
|
651 |
+
#: view/admin/log.php:70
|
652 |
+
msgid "IP"
|
653 |
+
msgstr "IP"
|
654 |
+
|
655 |
+
#: view/admin/log.php:85
|
656 |
+
msgid "There are no logs to display!"
|
657 |
+
msgstr "گزارشی برای نمایش نیست"
|
658 |
+
|
659 |
+
#: view/admin/log.php:94
|
660 |
+
msgid "Process Current Logs"
|
661 |
+
msgstr "فرآیند گزارش های رایج"
|
662 |
+
|
663 |
+
#: view/admin/log.php:95
|
664 |
+
msgid ""
|
665 |
+
"These actions will affect all currently available logs (i.e. your search "
|
666 |
+
"phrase will restrict the log items)."
|
667 |
+
msgstr "این عملها بر روی تمام گزارشهای دردسترس تاثیر میگذارد !"
|
668 |
+
|
669 |
+
#: view/admin/log.php:100
|
670 |
+
msgid "Delete Logs"
|
671 |
+
msgstr "پاک کردن گزارشها"
|
672 |
+
|
673 |
+
#: view/admin/log_item_details.php:9
|
674 |
+
msgid "Redirect to"
|
675 |
+
msgstr "تغییر مسیر به"
|
676 |
+
|
677 |
+
#: view/admin/log_item_details.php:15
|
678 |
+
msgid "Redirected by"
|
679 |
+
msgstr "تغییر مسیر داده شده بهوسیله"
|
680 |
+
|
681 |
+
#: view/admin/log_item_details.php:16
|
682 |
+
msgid "for"
|
683 |
+
msgstr "برای"
|
684 |
+
|
685 |
+
#: view/admin/module_item.php:23
|
686 |
+
msgid "View as"
|
687 |
+
msgstr "مشاهده بهعنوان"
|
688 |
+
|
689 |
+
#: view/admin/module_item.php:25
|
690 |
+
msgid "CSV"
|
691 |
+
msgstr "CSV"
|
692 |
+
|
693 |
+
#: view/admin/module_item.php:26
|
694 |
+
msgid "XML"
|
695 |
+
msgstr "XML"
|
696 |
+
|
697 |
+
#: view/admin/module_item.php:28
|
698 |
+
msgid "RSS"
|
699 |
+
msgstr "RSS"
|
700 |
+
|
701 |
+
#: view/admin/module_item.php:41
|
702 |
+
msgid "edit"
|
703 |
+
msgstr "ویرایش"
|
704 |
+
|
705 |
+
#: view/admin/module_item.php:43
|
706 |
+
msgid "delete"
|
707 |
+
msgstr "پاک کردن"
|
708 |
+
|
709 |
+
#: view/admin/module_item.php:45
|
710 |
+
msgid "reset"
|
711 |
+
msgstr "بازنشانی"
|
712 |
+
|
713 |
+
#: view/admin/module_list.php:6 view/admin/submenu.php:16
|
714 |
+
msgid "Modules"
|
715 |
+
msgstr "ماژولها"
|
716 |
+
|
717 |
+
#: view/admin/module_list.php:14
|
718 |
+
msgid "Details"
|
719 |
+
msgstr "توضیحات"
|
720 |
+
|
721 |
+
#: view/admin/module_list.php:15 view/admin/submenu.php:11
|
722 |
+
msgid "Groups"
|
723 |
+
msgstr "گروهها"
|
724 |
+
|
725 |
+
#: view/admin/module_list.php:16
|
726 |
+
msgid "Items"
|
727 |
+
msgstr "موارد"
|
728 |
+
|
729 |
+
#: view/admin/module_list.php:18
|
730 |
+
msgid "Operations"
|
731 |
+
msgstr "عملیاتها"
|
732 |
+
|
733 |
+
#: view/admin/module_list.php:27
|
734 |
+
msgid "Note: Hits are dependant on log entries"
|
735 |
+
msgstr "توجه داشته باشید: تعداد بازدید ها وابسته به اطلاعات ثبت شده می باشد"
|
736 |
+
|
737 |
+
#: view/admin/module_list.php:29
|
738 |
+
msgid "You have no modules defined yet"
|
739 |
+
msgstr "شما هیچ ماژول تعریف شدهاید ندارید"
|
740 |
+
|
741 |
+
#: view/admin/module_list.php:34
|
742 |
+
msgid "Add Module"
|
743 |
+
msgstr "افزودن ماژول"
|
744 |
+
|
745 |
+
#: view/admin/module_list.php:35
|
746 |
+
msgid ""
|
747 |
+
"A module is a controlling element that determines how redirections are "
|
748 |
+
"handled. Elements in a WordPress module are handled by WordPress, elements "
|
749 |
+
"in an Apache module are handled by <code>.htaccess</code>, and elements in a "
|
750 |
+
"404 module affect how 404 errors are logged."
|
751 |
+
msgstr ""
|
752 |
+
"ماژول به عنوان یک عنصر کنترل کننده است که تعیین میکند تغییر مسیرها چگونه "
|
753 |
+
"اعمال شوند. عناصر در ماژول وردپرس بهوسیله وردپرس و در آپاچی به وسیله ."
|
754 |
+
"htaccess و در ماژول ۴۰۴ تحت تاثیر گزارش های خطای ۴۰۴ میباشند."
|
755 |
+
|
756 |
+
#: view/admin/module_list.php:55
|
757 |
+
msgid "Create"
|
758 |
+
msgstr "ایجاد"
|
759 |
+
|
760 |
+
#: view/admin/options.php:6 view/admin/submenu.php:26
|
761 |
+
msgid "Options"
|
762 |
+
msgstr "نشانی"
|
763 |
+
|
764 |
+
#: view/admin/options.php:15
|
765 |
+
msgid "Auto-generate URL"
|
766 |
+
msgstr "ایجاد خودکار نشانی"
|
767 |
+
|
768 |
+
#: view/admin/options.php:19
|
769 |
+
msgid ""
|
770 |
+
"This will be used to auto-generate a URL if no URL is given. You can use "
|
771 |
+
"the special tags $dec$ or $hex$ to have a unique ID inserted (either decimal "
|
772 |
+
"or hex)"
|
773 |
+
msgstr ""
|
774 |
+
"این گزینه برای ایجاد نشانی خودکار استفاده میشود البته اگر نشانی داده نشود ! "
|
775 |
+
"شما میتوانید برای شخصی سازی بیشتر از تگهای $dec$ یا $hex$ استفاده کنید تا "
|
776 |
+
"یک ID یکتا داشته باشید"
|
777 |
+
|
778 |
+
#: view/admin/options.php:24
|
779 |
+
msgid "IP Lookup Service"
|
780 |
+
msgstr "سرویس جستوجوی IP"
|
781 |
+
|
782 |
+
#: view/admin/options.php:30
|
783 |
+
msgid "Plugin Support"
|
784 |
+
msgstr "پشتیبانی افزونه"
|
785 |
+
|
786 |
+
#: view/admin/options.php:33
|
787 |
+
msgid "I'm a nice person and I have helped support the author of this plugin"
|
788 |
+
msgstr "من خیلی باحالم پس نویسنده افزونه را در پشتیبانی این افزونه کمک میکنم !"
|
789 |
+
|
790 |
+
#: view/admin/options.php:37
|
791 |
+
msgid "Logging"
|
792 |
+
msgstr "ورود"
|
793 |
+
|
794 |
+
#: view/admin/options.php:40
|
795 |
+
msgid "log redirected requests"
|
796 |
+
msgstr "گزارش درخواستهای تغییر مسیر"
|
797 |
+
|
798 |
+
#: view/admin/options.php:42
|
799 |
+
msgid "log 404 Not Found requests"
|
800 |
+
msgstr "گزارش درخواستهای ۴۰۴ یافت نشد"
|
801 |
+
|
802 |
+
#: view/admin/options.php:43
|
803 |
+
msgid ""
|
804 |
+
"Uncheck one or both of these to turn off logging and reduce database load if "
|
805 |
+
"your redirected URLs are hit very frequently, and/or your site is very busy "
|
806 |
+
"and pages are often not found."
|
807 |
+
msgstr ""
|
808 |
+
"لغو انتخاب یک یا دو مورد از گزارش گیریها برای کاهش مصرف دیتابیس در صورتی که "
|
809 |
+
"سایت شما بسیار شلوغ است و برگهها اغلب یافت نمیشوند !"
|
810 |
+
|
811 |
+
#: view/admin/options.php:47
|
812 |
+
msgid "Expire Logs"
|
813 |
+
msgstr "گزارشهای منقضی شده"
|
814 |
+
|
815 |
+
#: view/admin/options.php:50
|
816 |
+
msgid "days (enter 0 for no expiry)"
|
817 |
+
msgstr "روزها (برای جلوگیری از انقضا عدد 0 را وارد کنید)"
|
818 |
+
|
819 |
+
#: view/admin/options.php:54
|
820 |
+
msgid "RSS Token"
|
821 |
+
msgstr "نشانی آراساس"
|
822 |
+
|
823 |
+
#: view/admin/options.php:57
|
824 |
+
msgid ""
|
825 |
+
"A unique token allowing feed readers access to Redirection RSS (leave blank "
|
826 |
+
"to auto-generate)"
|
827 |
+
msgstr ""
|
828 |
+
"یک نشانی یکتا که به خوانندگان امکان دسترسی به تغییر مسیر آراساس را میدهد "
|
829 |
+
"( برای ایجاد خودکار نشانی این زمینه را خالی رها کنید )"
|
830 |
+
|
831 |
+
#: view/admin/options.php:62
|
832 |
+
msgid "URL Monitoring"
|
833 |
+
msgstr "نظارت بر نشانی"
|
834 |
+
|
835 |
+
#: view/admin/options.php:63
|
836 |
+
msgid ""
|
837 |
+
"You can have Redirection detect changes in URLs and have an automatic "
|
838 |
+
"redirection created in a specific group."
|
839 |
+
msgstr ""
|
840 |
+
"شما می توانید داشته باشید : تشخیص تغییر مسیر تشخیص در آدرس ها و تغییر مسیر "
|
841 |
+
"خودکار در یک گروه خاص"
|
842 |
+
|
843 |
+
#: view/admin/options.php:67
|
844 |
+
msgid "Post & Page URLs"
|
845 |
+
msgstr "نوشته & نشانیهای برگه"
|
846 |
+
|
847 |
+
#: view/admin/options.php:70 view/admin/options.php:82
|
848 |
+
msgid "Don't monitor"
|
849 |
+
msgstr "جلوگیری از نظارت"
|
850 |
+
|
851 |
+
#: view/admin/options.php:74
|
852 |
+
msgid "Monitor new posts"
|
853 |
+
msgstr "نظارت در نوشتههای تازه"
|
854 |
+
|
855 |
+
#: view/admin/options.php:79
|
856 |
+
msgid "Category URLs"
|
857 |
+
msgstr "نشانیهای دستهبندی"
|
858 |
+
|
859 |
+
#: view/admin/options.php:89
|
860 |
+
msgid "Update"
|
861 |
+
msgstr "حدث"
|
862 |
+
|
863 |
+
#: view/admin/options.php:95
|
864 |
+
msgid "Import"
|
865 |
+
msgstr "درون ریزی"
|
866 |
+
|
867 |
+
#: view/admin/options.php:97
|
868 |
+
msgid ""
|
869 |
+
"Here you can import redirections from an existing .htaccess file, a CSV "
|
870 |
+
"file, or a Redirection XML."
|
871 |
+
msgstr ""
|
872 |
+
"در این قسمت شما میتوانید تغییر مسیرها را از یک پرونده .htaccess ٬ پرونده CSV "
|
873 |
+
"یا XML درون ریزی کنید."
|
874 |
+
|
875 |
+
#: view/admin/options.php:104
|
876 |
+
msgid "Import into"
|
877 |
+
msgstr "درونریزی به"
|
878 |
+
|
879 |
+
#: view/admin/options.php:107
|
880 |
+
msgid "Upload"
|
881 |
+
msgstr "ارسال"
|
882 |
+
|
883 |
+
#: view/admin/options.php:110
|
884 |
+
msgid "Note that the group is ignored when uploading an XML file."
|
885 |
+
msgstr "توجه کنید که گروهها در درونریزی XML در نظر گرفته نمیشوند !"
|
886 |
+
|
887 |
+
#: view/admin/options.php:114
|
888 |
+
msgid "Delete Redirection"
|
889 |
+
msgstr "پاک کردن تغییر مسیرها"
|
890 |
+
|
891 |
+
#: view/admin/options.php:115
|
892 |
+
msgid ""
|
893 |
+
"Selecting this option will delete all redirections, all logs, and any "
|
894 |
+
"options associated with the Redirection plugin. Make sure this is what you "
|
895 |
+
"want to do."
|
896 |
+
msgstr ""
|
897 |
+
"انتخاب این گزینه باعث پاک شدن تمامی تغییر مسیرها٬ گزارشها و تمامی تغییرات "
|
898 |
+
"اعمال شده در افزونه میشود ! پس مراقب باشید !"
|
899 |
+
|
900 |
+
#: view/admin/submenu.php:6
|
901 |
+
msgid "Redirects"
|
902 |
+
msgstr "تغییر مسیرها"
|
903 |
+
|
904 |
+
#: view/admin/submenu.php:21
|
905 |
+
msgid "Log"
|
906 |
+
msgstr "گزارشها"
|
907 |
+
|
908 |
+
#: view/admin/submenu.php:31
|
909 |
+
msgid "Support"
|
910 |
+
msgstr "پشتیبانی"
|
911 |
+
|
912 |
+
#: view/admin/support.php:5
|
913 |
+
msgid "Redirection Support"
|
914 |
+
msgstr "پشتیبانی تغییر مسیر"
|
915 |
+
|
916 |
+
#: view/admin/support.php:9
|
917 |
+
msgid ""
|
918 |
+
"Redirection is free to use - life is wonderful and lovely! However, it has "
|
919 |
+
"required a great deal of time and effort to develop and if it has been "
|
920 |
+
"useful you can help support this development by <strong>making a small "
|
921 |
+
"donation</strong>."
|
922 |
+
msgstr ""
|
923 |
+
"افزونه تغییر مسیر یک افزونه رایگان است - زندگی فوقالعاده و عاشقانه است ! اما "
|
924 |
+
"زمان زیادی برای توسعه و ساخت افزونه صرف شده است . شما میتوانید با کمکهای "
|
925 |
+
"نقدی کوچک خود در توسعه افزونه سهیم باشید."
|
926 |
+
|
927 |
+
#: view/admin/support.php:10
|
928 |
+
msgid ""
|
929 |
+
"This will act as an incentive for me to carry on developing, providing "
|
930 |
+
"countless hours of support, and including new features and suggestions. You "
|
931 |
+
"get some useful software and I get to carry on making it. Everybody wins."
|
932 |
+
msgstr ""
|
933 |
+
"این امر سبب میشود که توسعه افزونه ادامه داشته باشد و ساعات بیشتری صرف توسعه "
|
934 |
+
"این افزونه شود و هر نگارش شامل ویژگیهای تازه شود. همه برندهاند. "
|
935 |
+
|
936 |
+
#: view/admin/support.php:13
|
937 |
+
msgid ""
|
938 |
+
"If you are using this plugin in a commercial setup, or feel that it's been "
|
939 |
+
"particularly useful, then you may want to consider a <strong>commercial "
|
940 |
+
"donation</strong>."
|
941 |
+
msgstr ""
|
942 |
+
"اگر شما از این افزونه در راهاندازیهای تجاری استفاده میکنید یا این افزونه را "
|
943 |
+
"مفید میدانید شاید بخواهید کمکهای نقدی تجاری را گزینش کنید."
|
944 |
+
|
945 |
+
#: view/admin/support.php:36
|
946 |
+
msgid "Individual<br/>Donation"
|
947 |
+
msgstr "کمک مالی <br/> شخصی"
|
948 |
+
|
949 |
+
#: view/admin/support.php:56
|
950 |
+
msgid "Commercial<br/>Donation"
|
951 |
+
msgstr "کمک مالی <br/> تجاری"
|
952 |
+
|
953 |
+
#: view/admin/support.php:60
|
954 |
+
msgid "Translations"
|
955 |
+
msgstr "ترجمهها"
|
956 |
+
|
957 |
+
#: view/admin/support.php:62
|
958 |
+
msgid ""
|
959 |
+
"If you're multi-lingual then you may want to consider donating a translation:"
|
960 |
+
msgstr ""
|
961 |
+
"اگر به زبانی مسلط هستید شاید بخواهید ما را در ترجمه های این افزونه کمک کنید :"
|
962 |
+
|
963 |
+
#: view/admin/support.php:70
|
964 |
+
msgid ""
|
965 |
+
"All translators will have a link to their website placed on the plugin "
|
966 |
+
"homepage at <a href=\"http://urbangiraffe.com/plugins/redirection/"
|
967 |
+
"\">UrbanGiraffe</a>, in addition to being an individual supporter."
|
968 |
+
msgstr ""
|
969 |
+
"لینک وبسایت مترجم ها در صفحه افزونه در وبسایت <a href=\"http://urbangiraffe."
|
970 |
+
"com/plugins/redirection/\">زرافه شهری</a> قرار خواهد گرفت."
|
971 |
+
|
972 |
+
#: view/admin/support.php:71
|
973 |
+
msgid ""
|
974 |
+
"Full details of producing a translation can be found in this <a href="
|
975 |
+
"\"http://urbangiraffe.com/articles/translating-wordpress-themes-and-plugins/"
|
976 |
+
"\">guide to translating WordPress plugins</a>."
|
977 |
+
msgstr ""
|
978 |
+
"<a href=\"http://urbangiraffe.com/articles/translating-wordpress-themes-and-"
|
979 |
+
"plugins/\">آموزش ترجمه افزونه و پوسته وردپرس</a>."
|
980 |
+
|
981 |
+
#. Plugin URI of the plugin/theme
|
982 |
+
msgid "http://urbangiraffe.com/plugins/redirection/"
|
983 |
+
msgstr "http://urbangiraffe.com/plugins/redirection/"
|
984 |
+
|
985 |
+
#. Description of the plugin/theme
|
986 |
+
msgid "Manage all your 301 redirects and monitor 404 errors"
|
987 |
+
msgstr "مدیریت تمام ۳۰۱ تغییر مسیر و نظارت بر خطاهای ۴۰۴"
|
988 |
+
|
989 |
+
#. Author of the plugin/theme
|
990 |
+
msgid "John Godley"
|
991 |
+
msgstr "جان گادلی"
|
992 |
+
|
993 |
+
#. Author URI of the plugin/theme
|
994 |
+
msgid "http://urbangiraffe.com"
|
995 |
+
msgstr "http://urbangiraffe.com"
|
996 |
+
|
997 |
+
#~ msgid "How many widgets would you like?"
|
998 |
+
#~ msgstr "چه تعداد ابزارک را میپسندید ؟"
|
999 |
+
|
1000 |
+
#~ msgid "404 Report for: "
|
1001 |
+
#~ msgstr "404 Report for: "
|
1002 |
+
|
1003 |
+
#~ msgid ""
|
1004 |
+
#~ "An empty URL means the source URL is not redirected when the user is "
|
1005 |
+
#~ "logged in/logged out."
|
1006 |
+
#~ msgstr ""
|
1007 |
+
#~ "An empty URL means the source URL is not redirected when the user is "
|
1008 |
+
#~ "logged in/logged out."
|
1009 |
+
|
1010 |
+
#~ msgid "Redirect to one of several URLs"
|
1011 |
+
#~ msgstr "توجيه الى واحد من عناوينURL"
|
1012 |
+
|
1013 |
+
#~ msgid "Redirect based on referrer"
|
1014 |
+
#~ msgstr "Redirect based on referrer"
|
1015 |
+
|
1016 |
+
#~ msgid "Referrer Regex"
|
1017 |
+
#~ msgstr "Referrer Regex"
|
1018 |
+
|
1019 |
+
#~ msgid "Not from referrer"
|
1020 |
+
#~ msgstr "Not from referrer"
|
1021 |
+
|
1022 |
+
#~ msgid "An empty URL means the source URL is not redirected."
|
1023 |
+
#~ msgstr "المقصود URL خالي-URL الاصل لا يعتبر توجيه."
|
1024 |
+
|
1025 |
+
#~ msgid "Simple redirection"
|
1026 |
+
#~ msgstr "توجيه بسيط"
|
1027 |
+
|
1028 |
+
#~ msgid "Redirection 404 Log"
|
1029 |
+
#~ msgstr "Redirection 404 Log"
|
1030 |
+
|
1031 |
+
#~ msgid "You have no 404 logs!"
|
1032 |
+
#~ msgstr "لا يوجد سجلات اخطاء 404."
|
1033 |
+
|
1034 |
+
#~ msgid ""
|
1035 |
+
#~ "This will delete all logged 404 errors. Please be sure this is what you "
|
1036 |
+
#~ "want to do."
|
1037 |
+
#~ msgstr "هذه العملية قد تحذف جميع سجلات اخطاء 404.هل انت متأكد من الاستمرار؟"
|
1038 |
+
|
1039 |
+
#~ msgid "Add redirection"
|
1040 |
+
#~ msgstr "اضافة توجيه"
|
1041 |
+
|
1042 |
+
#~ msgid "at"
|
1043 |
+
#~ msgstr "عند"
|
1044 |
+
|
1045 |
+
#~ msgid "Method"
|
1046 |
+
#~ msgstr "اسلوب"
|
1047 |
+
|
1048 |
+
#~ msgid "Open referrer"
|
1049 |
+
#~ msgstr "توجيه مفتوح"
|
1050 |
+
|
1051 |
+
#~ msgid "Last Referrer"
|
1052 |
+
#~ msgstr "التوجيه الاخير"
|
1053 |
+
|
1054 |
+
#~ msgid "You have no logs!"
|
1055 |
+
#~ msgstr "لا يوجد سجلات"
|
1056 |
+
|
1057 |
+
#~ msgid "Create 301 when post slug changes"
|
1058 |
+
#~ msgstr "ایجاد 301 زمانی که"
|
1059 |
+
|
1060 |
+
#~ msgid "Redirect index.php/index.html"
|
1061 |
+
#~ msgstr "وجه index.php/index.html"
|
1062 |
+
|
1063 |
+
#~ msgid "Root domain"
|
1064 |
+
#~ msgstr "الملقم الاساسي"
|
1065 |
+
|
1066 |
+
#~ msgid "Check for updates"
|
1067 |
+
#~ msgstr "افحص التحديثات"
|
1068 |
+
|
1069 |
+
#~ msgid "%s Redirections"
|
1070 |
+
#~ msgstr "%s Redirections"
|
1071 |
+
|
1072 |
+
#~ msgid "%s ago"
|
1073 |
+
#~ msgstr "%s ago"
|
matches/login.php
CHANGED
@@ -29,12 +29,14 @@ class Login_Match extends Red_Match {
|
|
29 |
|
30 |
function show() {
|
31 |
?>
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
|
|
|
|
38 |
<tr>
|
39 |
<th width="100" valign="top">
|
40 |
<?php if ( strlen( $this->url_loggedin ) > 0 ) : ?>
|
@@ -47,10 +49,10 @@ class Login_Match extends Red_Match {
|
|
47 |
<input style="width: 95%" type="text" name="url_loggedin" value="<?php echo esc_attr( $this->url_loggedin ); ?>"/>
|
48 |
</td>
|
49 |
</tr>
|
50 |
-
<tr>
|
51 |
<th width="100" valign="top">
|
52 |
<?php if ( strlen( $this->url_loggedout ) > 0 ) : ?>
|
53 |
-
<a target="_blank" href="<?php echo $this->url_loggedout ?>"><?php _e( 'Logged Out', 'redirection' ); ?>:</a>
|
54 |
<?php else : ?>
|
55 |
<?php _e( 'Logged Out', 'redirection' ); ?>:
|
56 |
<?php endif; ?>
|
@@ -67,8 +69,8 @@ class Login_Match extends Red_Match {
|
|
67 |
$details['target'] = $details;
|
68 |
|
69 |
return array(
|
70 |
-
'url_loggedin' => $details['url_loggedin'],
|
71 |
-
'url_loggedout' => $details['url_loggedout']
|
72 |
);
|
73 |
}
|
74 |
|
29 |
|
30 |
function show() {
|
31 |
?>
|
32 |
+
<tr>
|
33 |
+
<th></th>
|
34 |
+
<td>
|
35 |
+
<p>
|
36 |
+
<?php _e( 'The target URL will be chosen from one of the following URLs, depending if the user is logged in or out. Leaving a URL blank means that the user is not redirected.', 'redirection' ); ?>
|
37 |
+
</p>
|
38 |
+
</td>
|
39 |
+
</tr>
|
40 |
<tr>
|
41 |
<th width="100" valign="top">
|
42 |
<?php if ( strlen( $this->url_loggedin ) > 0 ) : ?>
|
49 |
<input style="width: 95%" type="text" name="url_loggedin" value="<?php echo esc_attr( $this->url_loggedin ); ?>"/>
|
50 |
</td>
|
51 |
</tr>
|
52 |
+
<tr>
|
53 |
<th width="100" valign="top">
|
54 |
<?php if ( strlen( $this->url_loggedout ) > 0 ) : ?>
|
55 |
+
<a target="_blank" href="<?php echo esc_url( $this->url_loggedout ) ?>"><?php _e( 'Logged Out', 'redirection' ); ?>:</a>
|
56 |
<?php else : ?>
|
57 |
<?php _e( 'Logged Out', 'redirection' ); ?>:
|
58 |
<?php endif; ?>
|
69 |
$details['target'] = $details;
|
70 |
|
71 |
return array(
|
72 |
+
'url_loggedin' => isset( $details['url_loggedin'] ) ? $details['url_loggedin'] : false,
|
73 |
+
'url_loggedout' => isset( $details['url_loggedout'] ) ? $details['url_loggedout'] : false,
|
74 |
);
|
75 |
}
|
76 |
|
matches/referrer.php
CHANGED
@@ -53,10 +53,12 @@ class Referrer_Match extends Red_Match {
|
|
53 |
</select>
|
54 |
</td>
|
55 |
</tr>
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
|
|
|
|
60 |
<tr>
|
61 |
<th width="100" valign="top">
|
62 |
<?php if ( strlen( $this->url_from ) > 0 ) : ?>
|
@@ -88,9 +90,9 @@ class Referrer_Match extends Red_Match {
|
|
88 |
|
89 |
return array(
|
90 |
'url_from' => $details['url_from'],
|
91 |
-
'url_notfrom' => $details['url_notfrom'],
|
92 |
'regex' => isset( $details['regex'] ) ? true : false,
|
93 |
-
'referrer' => $details['referrer']
|
94 |
);
|
95 |
}
|
96 |
|
53 |
</select>
|
54 |
</td>
|
55 |
</tr>
|
56 |
+
<tr>
|
57 |
+
<th><?php _e( 'HTTP Code', 'redirection' ); ?>:</th>
|
58 |
+
<td>
|
59 |
+
<p style="padding: 0.5em"><?php _e( 'The visitor will be redirected from the source URL if the referrer matches. You can specify a <em>matched</em> target URL as the address to send visitors if they do match, and <em>not matched</em> if they don\'t match. Leaving a URL blank means that the visitor is not redirected.', 'redirection' ); ?></p>
|
60 |
+
</td>
|
61 |
+
</tr>
|
62 |
<tr>
|
63 |
<th width="100" valign="top">
|
64 |
<?php if ( strlen( $this->url_from ) > 0 ) : ?>
|
90 |
|
91 |
return array(
|
92 |
'url_from' => $details['url_from'],
|
93 |
+
'url_notfrom' => isset( $details['url_notfrom'] ) ? $details['url_notfrom'] : false,
|
94 |
'regex' => isset( $details['regex'] ) ? true : false,
|
95 |
+
'referrer' => isset( $details['referrer'] ) ? $details['referrer'] : false
|
96 |
);
|
97 |
}
|
98 |
|
matches/url.php
CHANGED
@@ -36,7 +36,7 @@ class URL_Match extends Red_Match {
|
|
36 |
</tr>
|
37 |
<?php endif; ?>
|
38 |
<?php if ( $this->action->can_change_code() ) : ?>
|
39 |
-
<tr>
|
40 |
<th><?php _e( 'HTTP Code', 'redirection' ); ?>:</th>
|
41 |
<td>
|
42 |
<select name="action_code">
|
36 |
</tr>
|
37 |
<?php endif; ?>
|
38 |
<?php if ( $this->action->can_change_code() ) : ?>
|
39 |
+
<tr class="advanced">
|
40 |
<th><?php _e( 'HTTP Code', 'redirection' ); ?>:</th>
|
41 |
<td>
|
42 |
<select name="action_code">
|
matches/user_agent.php
CHANGED
@@ -64,11 +64,13 @@ class Agent_Match extends Red_Match {
|
|
64 |
<?php endif; ?>
|
65 |
|
66 |
<?php if ( $this->action->can_perform_action() ) : ?>
|
67 |
-
|
68 |
-
|
|
|
|
|
69 |
', 'redirection' ); ?></p>
|
70 |
-
|
71 |
-
|
72 |
<tr>
|
73 |
<th width="100" valign="top">
|
74 |
<?php if ( strlen( $this->url_from ) > 0 ) : ?>
|
@@ -100,9 +102,9 @@ class Agent_Match extends Red_Match {
|
|
100 |
$details['url_from'] = $details['target'];
|
101 |
|
102 |
return array(
|
103 |
-
'url_from' => $details['url_from'],
|
104 |
-
'url_notfrom' => $details['url_notfrom'],
|
105 |
-
'user_agent' => $details['user_agent']
|
106 |
);
|
107 |
}
|
108 |
|
64 |
<?php endif; ?>
|
65 |
|
66 |
<?php if ( $this->action->can_perform_action() ) : ?>
|
67 |
+
<tr>
|
68 |
+
<th></th>
|
69 |
+
<td>
|
70 |
+
<p style="padding: 0.5em"><?php _e( 'The visitor will be redirected from the source URL if the user agent matches. You can specify a <em>matched</em> target URL as the address to send visitors if they do match, and <em>not matched</em> if they don\'t match. Leaving a URL blank means that the visitor is not redirected. <strong>All matches are performed as regular expressions</strong>.
|
71 |
', 'redirection' ); ?></p>
|
72 |
+
</td>
|
73 |
+
</tr>
|
74 |
<tr>
|
75 |
<th width="100" valign="top">
|
76 |
<?php if ( strlen( $this->url_from ) > 0 ) : ?>
|
102 |
$details['url_from'] = $details['target'];
|
103 |
|
104 |
return array(
|
105 |
+
'url_from' => isset( $details['url_from'] ) ? $details['url_from'] : false,
|
106 |
+
'url_notfrom' => isset( $details['url_notfrom'] ) ? $details['url_notfrom'] : false,
|
107 |
+
'user_agent' => isset( $details['user_agent'] ) ? $details['user_agent'] : false
|
108 |
);
|
109 |
}
|
110 |
|
models/group.php
CHANGED
@@ -124,7 +124,7 @@ class Red_Group {
|
|
124 |
$wpdb->insert( $wpdb->prefix.'redirection_groups', $data );
|
125 |
|
126 |
Red_Module::flush( $module );
|
127 |
-
return $wpdb->insert_id;
|
128 |
}
|
129 |
|
130 |
return false;
|
124 |
$wpdb->insert( $wpdb->prefix.'redirection_groups', $data );
|
125 |
|
126 |
Red_Module::flush( $module );
|
127 |
+
return Red_Group::get( $wpdb->insert_id );
|
128 |
}
|
129 |
|
130 |
return false;
|
models/htaccess.php
CHANGED
@@ -126,12 +126,12 @@ class Red_Htaccess {
|
|
126 |
}
|
127 |
|
128 |
function generate() {
|
129 |
-
|
130 |
-
|
131 |
|
132 |
$text[] = '# Created by Redirection';
|
133 |
$text[] = '# '.date ('r');
|
134 |
-
$text[] = '# Redirection '.$
|
135 |
$text[] = '';
|
136 |
|
137 |
// Default blocked files - I can't think of a reason not to block these
|
@@ -173,7 +173,7 @@ class Red_Htaccess {
|
|
173 |
$existing = @file_get_contents( $filename );
|
174 |
|
175 |
// Remove any existing Redirection module
|
176 |
-
$text .= preg_replace( '@# Created by Redirection
|
177 |
}
|
178 |
|
179 |
$file = @fopen( $filename, 'w' );
|
126 |
}
|
127 |
|
128 |
function generate() {
|
129 |
+
$version = get_plugin_data( __FILE__ );
|
130 |
+
$version = $version['Version'];
|
131 |
|
132 |
$text[] = '# Created by Redirection';
|
133 |
$text[] = '# '.date ('r');
|
134 |
+
$text[] = '# Redirection '.$version.' - http://urbangiraffe.com/plugins/redirection/';
|
135 |
$text[] = '';
|
136 |
|
137 |
// Default blocked files - I can't think of a reason not to block these
|
173 |
$existing = @file_get_contents( $filename );
|
174 |
|
175 |
// Remove any existing Redirection module
|
176 |
+
$text .= preg_replace( '@# Created by Redirection(.*?)# End of Redirection@sm', '', $existing );
|
177 |
}
|
178 |
|
179 |
$file = @fopen( $filename, 'w' );
|
models/pager.php
CHANGED
@@ -42,7 +42,7 @@ class Redirection_Table extends WP_List_Table {
|
|
42 |
}
|
43 |
|
44 |
function column_hits( $item ) {
|
45 |
-
return esc_html( $item->last_count );
|
46 |
}
|
47 |
|
48 |
function column_url( $item ) {
|
@@ -60,7 +60,11 @@ class Redirection_Table extends WP_List_Table {
|
|
60 |
$after = '</span>';
|
61 |
}
|
62 |
|
63 |
-
|
|
|
|
|
|
|
|
|
64 |
}
|
65 |
|
66 |
function column_cb($item){
|
@@ -159,7 +163,7 @@ class Redirection_Table extends WP_List_Table {
|
|
159 |
$screen = get_current_screen();
|
160 |
|
161 |
$per_page = 25;
|
162 |
-
if ( $screen->get_option( 'per_page', 'option' ) ) {
|
163 |
$per_page = intval( get_user_meta( $current_user->ID, $screen->get_option( 'per_page', 'option' ), true ) );
|
164 |
if ( $per_page === 0 )
|
165 |
$per_page = 25;
|
@@ -373,6 +377,8 @@ class Redirection_Group_Table extends WP_List_Table {
|
|
373 |
}
|
374 |
|
375 |
class Redirection_Log_Table extends WP_List_Table {
|
|
|
|
|
376 |
private $lookup;
|
377 |
|
378 |
function __construct( $options ) {
|
@@ -402,7 +408,7 @@ class Redirection_Log_Table extends WP_List_Table {
|
|
402 |
|
403 |
function column_url( $item ) {
|
404 |
$actions = array(
|
405 |
-
'target' => esc_html( $item->sent_to ),
|
406 |
);
|
407 |
|
408 |
return sprintf( '%1$s %2$s', '<a href="'.esc_url( $item->url ).'">'.esc_html( $item->show_url( $item->url ) ).'</a>', $this->row_actions( $actions ) );
|
@@ -410,7 +416,7 @@ class Redirection_Log_Table extends WP_List_Table {
|
|
410 |
|
411 |
function column_referrer( $item ) {
|
412 |
$actions = array(
|
413 |
-
'agent' => esc_html( $item->agent ),
|
414 |
);
|
415 |
|
416 |
return sprintf( '%1$s %2$s', '<a href="'.esc_url( $item->referrer ).'">'.esc_html( parse_url( $item->referrer, PHP_URL_HOST ) ).'</a>', $this->row_actions( $actions ) );
|
@@ -672,7 +678,7 @@ class Redirection_Module_Table extends WP_List_Table {
|
|
672 |
}
|
673 |
|
674 |
function column_hits( $item ) {
|
675 |
-
return esc_html( $item->hits() );
|
676 |
}
|
677 |
|
678 |
function column_moduletype( $item ) {
|
42 |
}
|
43 |
|
44 |
function column_hits( $item ) {
|
45 |
+
return esc_html( number_format_i18n( $item->last_count, 0 ) );
|
46 |
}
|
47 |
|
48 |
function column_url( $item ) {
|
60 |
$after = '</span>';
|
61 |
}
|
62 |
|
63 |
+
$title = $item->url;
|
64 |
+
if ( $item->title )
|
65 |
+
$title = $item->title;
|
66 |
+
|
67 |
+
return sprintf( '%1$s %2$s', $before.'<a href="'.esc_url( $item->url ).'">'.esc_html( $title ).'</a>'.$after, $this->row_actions( $actions ) );
|
68 |
}
|
69 |
|
70 |
function column_cb($item){
|
163 |
$screen = get_current_screen();
|
164 |
|
165 |
$per_page = 25;
|
166 |
+
if ( $screen && $screen->get_option( 'per_page', 'option' ) ) {
|
167 |
$per_page = intval( get_user_meta( $current_user->ID, $screen->get_option( 'per_page', 'option' ), true ) );
|
168 |
if ( $per_page === 0 )
|
169 |
$per_page = 25;
|
377 |
}
|
378 |
|
379 |
class Redirection_Log_Table extends WP_List_Table {
|
380 |
+
const REFERRER_MAX = 120;
|
381 |
+
const TARGET_MAX = 80;
|
382 |
private $lookup;
|
383 |
|
384 |
function __construct( $options ) {
|
408 |
|
409 |
function column_url( $item ) {
|
410 |
$actions = array(
|
411 |
+
'target' => esc_html( substr( $item->sent_to, 0, self::TARGET_MAX ) ),
|
412 |
);
|
413 |
|
414 |
return sprintf( '%1$s %2$s', '<a href="'.esc_url( $item->url ).'">'.esc_html( $item->show_url( $item->url ) ).'</a>', $this->row_actions( $actions ) );
|
416 |
|
417 |
function column_referrer( $item ) {
|
418 |
$actions = array(
|
419 |
+
'agent' => esc_html( substr( $item->agent, 0, self::REFERRER_MAX ) ),
|
420 |
);
|
421 |
|
422 |
return sprintf( '%1$s %2$s', '<a href="'.esc_url( $item->referrer ).'">'.esc_html( parse_url( $item->referrer, PHP_URL_HOST ) ).'</a>', $this->row_actions( $actions ) );
|
678 |
}
|
679 |
|
680 |
function column_hits( $item ) {
|
681 |
+
return esc_html( number_format_i18n( $item->hits(), 0 ) );
|
682 |
}
|
683 |
|
684 |
function column_moduletype( $item ) {
|
modules/wordpress.php
CHANGED
@@ -41,25 +41,18 @@ class WordPress_Module extends Red_Module {
|
|
41 |
}
|
42 |
}
|
43 |
|
44 |
-
function protected_url( $url )
|
45 |
-
{
|
46 |
-
global $redirection;
|
47 |
-
$part = explode( '?', $url );
|
48 |
-
|
49 |
-
if ( $part[0] == str_replace( get_bloginfo( 'url' ), '', $redirection->url() ).'/ajax.php' || strpos($url, 'wp-cron.php' ) !== false )
|
50 |
-
return true;
|
51 |
return false;
|
52 |
}
|
53 |
|
54 |
-
function status_header( $status )
|
55 |
-
{
|
56 |
// Fix for incorrect headers sent when using FastCGI/IIS
|
57 |
if ( substr( php_sapi_name(), 0, 3 ) == 'cgi' )
|
58 |
return str_replace( 'HTTP/1.1', 'Status:', $status );
|
59 |
return $status;
|
60 |
}
|
61 |
|
62 |
-
function send_headers( $obj )
|
63 |
if ( !empty( $this->matched ) && $this->matched->match->action_code == '410' ) {
|
64 |
add_filter( 'status_header', array( &$this, 'set_header_410' ) );
|
65 |
}
|
@@ -102,16 +95,14 @@ class WordPress_Module extends Red_Module {
|
|
102 |
return $skip;
|
103 |
}
|
104 |
|
105 |
-
function is_valid()
|
106 |
-
{
|
107 |
$perm = get_option( 'permalink_structure' );
|
108 |
if ( $perm === false || $perm == '' )
|
109 |
return false;
|
110 |
return true;
|
111 |
}
|
112 |
|
113 |
-
function options()
|
114 |
-
{
|
115 |
if ( !$this->is_valid() )
|
116 |
echo __( '<strong>Disabled: You must enable <a href="options-permalink.php">permalinks</a> before using this</strong>', 'redirection' );
|
117 |
}
|
41 |
}
|
42 |
}
|
43 |
|
44 |
+
function protected_url( $url ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
return false;
|
46 |
}
|
47 |
|
48 |
+
function status_header( $status ) {
|
|
|
49 |
// Fix for incorrect headers sent when using FastCGI/IIS
|
50 |
if ( substr( php_sapi_name(), 0, 3 ) == 'cgi' )
|
51 |
return str_replace( 'HTTP/1.1', 'Status:', $status );
|
52 |
return $status;
|
53 |
}
|
54 |
|
55 |
+
function send_headers( $obj ) {
|
56 |
if ( !empty( $this->matched ) && $this->matched->match->action_code == '410' ) {
|
57 |
add_filter( 'status_header', array( &$this, 'set_header_410' ) );
|
58 |
}
|
95 |
return $skip;
|
96 |
}
|
97 |
|
98 |
+
function is_valid() {
|
|
|
99 |
$perm = get_option( 'permalink_structure' );
|
100 |
if ( $perm === false || $perm == '' )
|
101 |
return false;
|
102 |
return true;
|
103 |
}
|
104 |
|
105 |
+
function options() {
|
|
|
106 |
if ( !$this->is_valid() )
|
107 |
echo __( '<strong>Disabled: You must enable <a href="options-permalink.php">permalinks</a> before using this</strong>', 'redirection' );
|
108 |
}
|
plugin.php
DELETED
@@ -1,515 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
// ======================================================================================
|
4 |
-
// This library is free software; you can redistribute it and/or
|
5 |
-
// modify it under the terms of the GNU Lesser General Public
|
6 |
-
// License as published by the Free Software Foundation; either
|
7 |
-
// version 2.1 of the License, or(at your option) any later version.
|
8 |
-
//
|
9 |
-
// This library is distributed in the hope that it will be useful,
|
10 |
-
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11 |
-
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
12 |
-
// Lesser General Public License for more details.
|
13 |
-
// ======================================================================================
|
14 |
-
// @author John Godley(http://urbangiraffe.com)
|
15 |
-
// @version 0.2.7
|
16 |
-
// @copyright Copyright © 2009 John Godley, All Rights Reserved
|
17 |
-
// ======================================================================================
|
18 |
-
// 0.1.6 - Corrected WP locale functions
|
19 |
-
// 0.1.7 - Add phpdoc comments
|
20 |
-
// 0.1.8 - Support for Admin SSL
|
21 |
-
// 0.1.9 - URL encoding, defer localization until init
|
22 |
-
// 0.1.10 - Better URL encoding
|
23 |
-
// 0.1.11 - Make work in WP 2.0, fix HTTPS issue on IIS
|
24 |
-
// 0.1.12 - Activation/deactivation actions that take into account the directory
|
25 |
-
// 0.1.13 - Add realpath function
|
26 |
-
// 0.1.14 - Add select/checked functions, fix locale loader
|
27 |
-
// 0.1.15 - Remove dependency on prototype
|
28 |
-
// 0.1.16 - Add support for homedir in realpath
|
29 |
-
// 0.1.17 - Added widget class
|
30 |
-
// 0.1.18 - Expand checked function
|
31 |
-
// 0.1.19 - Make url() cope with sites with no trailing slash
|
32 |
-
// 0.1.20 - Change init function to prevent overloading
|
33 |
-
// 0.1.21 - Make widget work for WP 2.1
|
34 |
-
// 0.1.22 - Make select work with option groups, RSS compatability fix
|
35 |
-
// 0.1.23 - Make widget count work better, fix widgets in K2
|
36 |
-
// 0.1.24 - Make realpath better
|
37 |
-
// 0.1.25 - Support for new WP2.6 config location
|
38 |
-
// 0.1.26 - Add description to widget class
|
39 |
-
// 0.1.27 - Realpath on windows again
|
40 |
-
// 0.1.28 - Plugin version information
|
41 |
-
// 0.1.29 - Plugin version for older WP
|
42 |
-
// 0.1.30 - Add htmlspecialchars for non-support charsets
|
43 |
-
// 0.2 - WP Coding style
|
44 |
-
// 0.2.1 - Better HTTPS detection
|
45 |
-
// 0.2.2 - Plugin settings, base function
|
46 |
-
// 0.2.3 - More HTTPS
|
47 |
-
// 0.2.4 - Ajax helper, more compatability functions
|
48 |
-
// 0.2.5 - _n helper
|
49 |
-
// 0.2.6 - Compatability functions js_esc
|
50 |
-
// 0.2.7 - Allow multiple hooks in add_action/add_filter
|
51 |
-
// ======================================================================================
|
52 |
-
|
53 |
-
|
54 |
-
/**
|
55 |
-
* Wraps up several useful functions for WordPress plugins and provides a method to separate
|
56 |
-
* display HTML from PHP code.
|
57 |
-
*
|
58 |
-
* <h4>Display Rendering</h4>
|
59 |
-
* The class uses a similar technique to Ruby On Rails views, whereby the display HTML is kept
|
60 |
-
* in a separate directory and file from the main code. A display is 'rendered'(sent to the browser)
|
61 |
-
* or 'captured'(returned to the calling function).
|
62 |
-
*
|
63 |
-
* Template files are separated into two areas: admin and user. Admin templates are only for display in
|
64 |
-
* the WordPress admin interface, while user templates are typically for display on the site(although neither
|
65 |
-
* of these are enforced). All templates are PHP code, but are referred to without .php extension.
|
66 |
-
*
|
67 |
-
* The reason for this separation is that one golden rule of plugin creation is that someone will always want to change
|
68 |
-
* the formatting and style of your output. Rather than forcing them to modify the plugin(bad), or modify files within
|
69 |
-
* the plugin(equally bad), the class allows user templates to be overridden with files contained within the theme.
|
70 |
-
*
|
71 |
-
* An additional benefit is that it leads to code re-use, especially with regards to Ajax(i.e. your display code can be called from
|
72 |
-
* many locations)
|
73 |
-
*
|
74 |
-
* Template files are located within the 'view' subdirectory of the plugins base(specified when registering the plugin):
|
75 |
-
*
|
76 |
-
* <pre>myplugin/view/admin
|
77 |
-
* myplugin/view/myplugin</pre>
|
78 |
-
*
|
79 |
-
* Admin templates are contained within 'admin', and user templates are contained within a directory of the same name as the plugin.
|
80 |
-
*
|
81 |
-
* User files can be overridden within the theme by creating a similar directory structure:
|
82 |
-
*
|
83 |
-
* <pre>/themes/mytheme/view/myplugin</pre>
|
84 |
-
*
|
85 |
-
* The class will first look in the theme and then defaults to the plugin. A plugin should always provide default templates.
|
86 |
-
*
|
87 |
-
* <h4>Display Parameters</h4>
|
88 |
-
* Also similar to Ruby On Rails, when you display a template you must supply the parameters that the template has access to. This tries
|
89 |
-
* to ensure a very clean separation between code and display. Parameters are supplied as an associative array mapping variable name to variable value.
|
90 |
-
*
|
91 |
-
* For example,
|
92 |
-
*
|
93 |
-
* array( 'message' => 'Your data was processed', 'items' => 103);
|
94 |
-
*
|
95 |
-
* <h4>How it works in practice</h4>
|
96 |
-
* You create a template file to display how many items have been processed. You store this in 'view/admin/processed.php':
|
97 |
-
*
|
98 |
-
* <pre><p>You processed <?php echo $items ?> items</p></pre>
|
99 |
-
*
|
100 |
-
* When you want to display this in your plugin you use:
|
101 |
-
*
|
102 |
-
* <pre> $this->render_admin( 'processed', array( 'items' => 100));</pre>
|
103 |
-
*
|
104 |
-
* @package WordPress base library
|
105 |
-
* @author John Godley
|
106 |
-
* @copyright Copyright(C) John Godley
|
107 |
-
**/
|
108 |
-
|
109 |
-
class Redirection_Plugin {
|
110 |
-
/**
|
111 |
-
* Plugin name
|
112 |
-
* @var string
|
113 |
-
**/
|
114 |
-
var $plugin_name;
|
115 |
-
|
116 |
-
/**
|
117 |
-
* Plugin 'view' directory
|
118 |
-
* @var string Directory
|
119 |
-
**/
|
120 |
-
var $plugin_base;
|
121 |
-
|
122 |
-
/**
|
123 |
-
* Version URL(if enabled)
|
124 |
-
* @var string URL
|
125 |
-
**/
|
126 |
-
var $version_url;
|
127 |
-
|
128 |
-
/**
|
129 |
-
* Register your plugin with a name and base directory. This <strong>must</strong> be called once.
|
130 |
-
*
|
131 |
-
* @param string $name Name of your plugin. Is used to determine the plugin locale domain
|
132 |
-
* @param string $base Directory containing the plugin's 'view' files.
|
133 |
-
* @return void
|
134 |
-
**/
|
135 |
-
function register_plugin( $name, $base ) {
|
136 |
-
$this->plugin_base = rtrim( dirname( $base ), '/' );
|
137 |
-
$this->plugin_name = $name;
|
138 |
-
|
139 |
-
$this->add_action( 'init', 'load_locale' );
|
140 |
-
}
|
141 |
-
|
142 |
-
/**
|
143 |
-
* Hook called to change the locale directory
|
144 |
-
* @return void
|
145 |
-
**/
|
146 |
-
function load_locale() {
|
147 |
-
// Here we manually fudge the plugin locale as WP doesnt allow many options
|
148 |
-
$locale = get_locale();
|
149 |
-
if( empty( $locale ) )
|
150 |
-
$locale = 'en_US';
|
151 |
-
|
152 |
-
$mofile = dirname( __FILE__ )."/locale/$locale.mo";
|
153 |
-
load_textdomain( $this->plugin_name, $mofile );
|
154 |
-
}
|
155 |
-
|
156 |
-
|
157 |
-
/**
|
158 |
-
* Register a WordPress action and map it back to the calling object
|
159 |
-
*
|
160 |
-
* @param mixed $action Name of the action (single string or array of strings)
|
161 |
-
* @param string $function Function name (optional, if an array is given for $action then first $action is used as function name)
|
162 |
-
* @param int $priority WordPress priority(optional)
|
163 |
-
* @param int $accepted_args Number of arguments the function accepts(optional)
|
164 |
-
* @return void
|
165 |
-
**/
|
166 |
-
function add_action( $actions, $function = '', $priority = 10, $accepted_args = 1 ) {
|
167 |
-
if ( !is_array( $actions ) )
|
168 |
-
$actions = array( $actions );
|
169 |
-
|
170 |
-
foreach ( $actions AS $action ) {
|
171 |
-
add_action( $action, array( &$this, $function == '' ? $actions[0] : $function ), $priority, $accepted_args );
|
172 |
-
}
|
173 |
-
}
|
174 |
-
|
175 |
-
|
176 |
-
/**
|
177 |
-
* Register a WordPress filter and map it back to the calling object
|
178 |
-
*
|
179 |
-
* @param mixed $action Name of the action (single string or array of strings)
|
180 |
-
* @param string $function Function name (optional, if an array is given for $action then first $action is used as function name)
|
181 |
-
* @param int $priority WordPress priority(optional)
|
182 |
-
* @param int $accepted_args Number of arguments the function accepts(optional)
|
183 |
-
* @return void
|
184 |
-
**/
|
185 |
-
function add_filter( $filters, $function = '', $priority = 10, $accepted_args = 1 ) {
|
186 |
-
if ( !is_array( $filters ) )
|
187 |
-
$filters = array( $filters );
|
188 |
-
|
189 |
-
foreach ( $filters AS $filter ) {
|
190 |
-
add_filter( $filter, array( &$this, $function == '' ? $filters[0] : $function ), $priority, $accepted_args );
|
191 |
-
}
|
192 |
-
}
|
193 |
-
|
194 |
-
|
195 |
-
/**
|
196 |
-
* Special activation function that takes into account the plugin directory
|
197 |
-
*
|
198 |
-
* @param string $pluginfile The plugin file location(i.e. __FILE__)
|
199 |
-
* @param string $function Optional function name, or default to 'activate'
|
200 |
-
* @return void
|
201 |
-
**/
|
202 |
-
function register_activation( $pluginfile, $function = '' ) {
|
203 |
-
add_action( 'activate_'.basename( dirname( $pluginfile ) ).'/'.basename( $pluginfile ), array( &$this, $function == '' ? 'activate' : $function ) );
|
204 |
-
}
|
205 |
-
|
206 |
-
function register_ajax( $action, $function = '', $priority = 10 ) {
|
207 |
-
add_action( 'wp_ajax_'.$action, array( &$this, $function == '' ? $action : $function ), $priority );
|
208 |
-
}
|
209 |
-
|
210 |
-
/**
|
211 |
-
* Special deactivation function that takes into account the plugin directory
|
212 |
-
*
|
213 |
-
* @param string $pluginfile The plugin file location(i.e. __FILE__)
|
214 |
-
* @param string $function Optional function name, or default to 'deactivate'
|
215 |
-
* @return void
|
216 |
-
**/
|
217 |
-
function register_deactivation( $pluginfile, $function = '' ) {
|
218 |
-
add_action( 'deactivate_'.basename( dirname( $pluginfile ) ).'/'.basename( $pluginfile ), array( &$this, $function == '' ? 'deactivate' : $function ) );
|
219 |
-
}
|
220 |
-
|
221 |
-
function register_plugin_settings( $pluginfile, $function = '' ) {
|
222 |
-
add_action( 'plugin_action_links_'.basename( dirname( $pluginfile ) ).'/'.basename( $pluginfile ), array( &$this, $function == '' ? 'plugin_settings' : $function ), 10, 4 );
|
223 |
-
}
|
224 |
-
|
225 |
-
/**
|
226 |
-
* Renders an admin section of display code
|
227 |
-
*
|
228 |
-
* @param string $ug_name Name of the admin file(without extension)
|
229 |
-
* @param string $array Array of variable name=>value that is available to the display code(optional)
|
230 |
-
* @return void
|
231 |
-
**/
|
232 |
-
function render_admin( $ug_name, $ug_vars = array() ) {
|
233 |
-
global $plugin_base;
|
234 |
-
|
235 |
-
foreach ( $ug_vars AS $key => $val ) {
|
236 |
-
$$key = $val;
|
237 |
-
}
|
238 |
-
|
239 |
-
if ( file_exists( "{$this->plugin_base}/view/admin/$ug_name.php" ) )
|
240 |
-
include "{$this->plugin_base}/view/admin/$ug_name.php";
|
241 |
-
else
|
242 |
-
echo "<p>Rendering of admin template {$this->plugin_base}/view/admin/$ug_name.php failed</p>";
|
243 |
-
}
|
244 |
-
|
245 |
-
/**
|
246 |
-
* Renders a section of user display code. The code is first checked for in the current theme display directory
|
247 |
-
* before defaulting to the plugin
|
248 |
-
*
|
249 |
-
* @param string $ug_name Name of the admin file(without extension)
|
250 |
-
* @param string $array Array of variable name=>value that is available to the display code(optional)
|
251 |
-
* @return void
|
252 |
-
**/
|
253 |
-
function render( $ug_name, $ug_vars = array() ) {
|
254 |
-
foreach ( $ug_vars AS $key => $val ) {
|
255 |
-
$$key = $val;
|
256 |
-
}
|
257 |
-
|
258 |
-
if ( file_exists( TEMPLATEPATH."/view/{$this->plugin_name}/$ug_name.php" ) )
|
259 |
-
include TEMPLATEPATH."/view/{$this->plugin_name}/$ug_name.php";
|
260 |
-
elseif ( file_exists( "{$this->plugin_base}/view/{$this->plugin_name}/$ug_name.php" ) )
|
261 |
-
include "{$this->plugin_base}/view/{$this->plugin_name}/$ug_name.php";
|
262 |
-
else
|
263 |
-
echo "<p>Rendering of template $ug_name.php failed</p>";
|
264 |
-
}
|
265 |
-
|
266 |
-
/**
|
267 |
-
* Renders a section of user display code. The code is first checked for in the current theme display directory
|
268 |
-
* before defaulting to the plugin
|
269 |
-
*
|
270 |
-
* @param string $ug_name Name of the admin file(without extension)
|
271 |
-
* @param string $array Array of variable name=>value that is available to the display code(optional)
|
272 |
-
* @return void
|
273 |
-
**/
|
274 |
-
function capture( $ug_name, $ug_vars = array() ) {
|
275 |
-
ob_start();
|
276 |
-
|
277 |
-
$this->render( $ug_name, $ug_vars );
|
278 |
-
$output = ob_get_contents();
|
279 |
-
|
280 |
-
ob_end_clean();
|
281 |
-
return $output;
|
282 |
-
}
|
283 |
-
|
284 |
-
/**
|
285 |
-
* Captures an admin section of display code
|
286 |
-
*
|
287 |
-
* @param string $ug_name Name of the admin file(without extension)
|
288 |
-
* @param string $array Array of variable name=>value that is available to the display code(optional)
|
289 |
-
* @return string Captured code
|
290 |
-
**/
|
291 |
-
function capture_admin( $ug_name, $ug_vars = array() ) {
|
292 |
-
ob_start();
|
293 |
-
|
294 |
-
$this->render_admin( $ug_name, $ug_vars );
|
295 |
-
$output = ob_get_contents();
|
296 |
-
|
297 |
-
ob_end_clean();
|
298 |
-
return $output;
|
299 |
-
}
|
300 |
-
|
301 |
-
/**
|
302 |
-
* Display a standard error message(using CSS ID 'message' and classes 'fade' and 'error)
|
303 |
-
*
|
304 |
-
* @param string $message Message to display
|
305 |
-
* @return void
|
306 |
-
**/
|
307 |
-
function render_error( $message ) {
|
308 |
-
?>
|
309 |
-
<div class="fade error" id="message">
|
310 |
-
<p><?php echo $message ?></p>
|
311 |
-
</div>
|
312 |
-
<?php
|
313 |
-
}
|
314 |
-
|
315 |
-
/**
|
316 |
-
* Display a standard notice(using CSS ID 'message' and class 'updated' ).
|
317 |
-
* Note that the notice can be made to automatically disappear, and can be removed
|
318 |
-
* by clicking on it.
|
319 |
-
*
|
320 |
-
* @param string $message Message to display
|
321 |
-
* @param int $timeout Number of seconds to automatically remove the message(optional)
|
322 |
-
* @return void
|
323 |
-
**/
|
324 |
-
function render_message( $message, $timeout = 0 ) {
|
325 |
-
?>
|
326 |
-
<div class="updated" id="message" onclick="this.parentNode.removeChild(this)">
|
327 |
-
<p><?php echo $message ?></p>
|
328 |
-
</div>
|
329 |
-
<?php
|
330 |
-
}
|
331 |
-
|
332 |
-
/**
|
333 |
-
* Get the plugin's base directory
|
334 |
-
*
|
335 |
-
* @return string Base directory
|
336 |
-
**/
|
337 |
-
function dir() {
|
338 |
-
return $this->plugin_base;
|
339 |
-
}
|
340 |
-
|
341 |
-
function base () {
|
342 |
-
return admin_url( $this->plugin_name );
|
343 |
-
}
|
344 |
-
|
345 |
-
/**
|
346 |
-
* Get a URL to the plugin. Useful for specifying JS and CSS files
|
347 |
-
*
|
348 |
-
* For example, <img src="<?php echo $this->url() ?>/myimage.png"/>
|
349 |
-
*
|
350 |
-
* @return string URL
|
351 |
-
**/
|
352 |
-
function url( $url = '' ) {
|
353 |
-
if ( $url )
|
354 |
-
return str_replace( '\\', urlencode( '\\' ), str_replace( '&amp', '&', str_replace( '&', '&', $url ) ) );
|
355 |
-
|
356 |
-
$root = ABSPATH;
|
357 |
-
if ( defined( 'WP_PLUGIN_DIR' ) )
|
358 |
-
$root = WP_PLUGIN_DIR;
|
359 |
-
|
360 |
-
$url = substr( $this->plugin_base, strlen( $this->realpath( $root ) ) );
|
361 |
-
if ( DIRECTORY_SEPARATOR != '/' )
|
362 |
-
$url = str_replace( DIRECTORY_SEPARATOR, '/', $url );
|
363 |
-
|
364 |
-
if ( defined( 'WP_PLUGIN_URL' ) )
|
365 |
-
$url = WP_PLUGIN_URL.'/'.ltrim( $url, '/' );
|
366 |
-
else
|
367 |
-
$url = get_bloginfo( 'wpurl' ).'/'.ltrim( $url, '/' );
|
368 |
-
|
369 |
-
// Do an SSL check - only works on Apache
|
370 |
-
global $is_IIS;
|
371 |
-
if ( isset( $_SERVER['HTTPS'] ) && strtolower( $_SERVER['HTTPS'] ) == 'on' && $is_IIS === false )
|
372 |
-
$url = str_replace( 'http://', 'https://', $url );
|
373 |
-
|
374 |
-
return $url;
|
375 |
-
}
|
376 |
-
|
377 |
-
/**
|
378 |
-
* Version of realpath that will work on systems without realpath
|
379 |
-
*
|
380 |
-
* @param string $path The path to canonicalize
|
381 |
-
* @return string Canonicalized path
|
382 |
-
**/
|
383 |
-
function realpath( $path ) {
|
384 |
-
if ( function_exists( 'realpath' ) && DIRECTORY_SEPARATOR == '/' )
|
385 |
-
return realpath( $path );
|
386 |
-
elseif ( DIRECTORY_SEPARATOR == '/' )
|
387 |
-
{
|
388 |
-
$path = preg_replace( '/^~/', $_SERVER['DOCUMENT_ROOT'], $path );
|
389 |
-
|
390 |
-
// canonicalize
|
391 |
-
$path = explode( DIRECTORY_SEPARATOR, $path );
|
392 |
-
$newpath = array();
|
393 |
-
|
394 |
-
for ( $i = 0; $i < count( $path ); $i++ ) {
|
395 |
-
if ( $path[$i] === '' || $path[$i] === '.' )
|
396 |
-
continue;
|
397 |
-
|
398 |
-
if ( $path[$i] === '..' ) {
|
399 |
-
array_pop( $newpath );
|
400 |
-
continue;
|
401 |
-
}
|
402 |
-
|
403 |
-
array_push( $newpath, $path[$i] );
|
404 |
-
}
|
405 |
-
|
406 |
-
return DIRECTORY_SEPARATOR.implode( DIRECTORY_SEPARATOR, $newpath );
|
407 |
-
}
|
408 |
-
|
409 |
-
return $path;
|
410 |
-
}
|
411 |
-
|
412 |
-
/**
|
413 |
-
* Helper function to check a checkbox if the item has been checked
|
414 |
-
*
|
415 |
-
* @param mixed $item Checkbox value, or array of checkbox values: field => value
|
416 |
-
* @param string $field Fieldname, if array is given for $item
|
417 |
-
* @return void
|
418 |
-
**/
|
419 |
-
function checked( $item, $field = '' ) {
|
420 |
-
if ( $field && is_array( $item ) ) {
|
421 |
-
if ( isset( $item[$field] ) && $item[$field] )
|
422 |
-
echo ' checked="checked"';
|
423 |
-
}
|
424 |
-
elseif ( !empty( $item ) )
|
425 |
-
echo ' checked="checked"';
|
426 |
-
}
|
427 |
-
|
428 |
-
/**
|
429 |
-
* Helper function to display a dropdown select box
|
430 |
-
*
|
431 |
-
* @param array $items Associative array of: fieldname => label
|
432 |
-
* @param string $default Default fieldname to select
|
433 |
-
* @return void
|
434 |
-
**/
|
435 |
-
function select( $items, $default = '' ) {
|
436 |
-
if ( count( $items ) > 0 ) {
|
437 |
-
foreach ( $items AS $key => $value ) {
|
438 |
-
if ( is_array( $value ) ) {
|
439 |
-
echo '<optgroup label="'.esc_attr( $key ).'">';
|
440 |
-
|
441 |
-
foreach ( $value AS $sub => $subvalue ) {
|
442 |
-
echo '<option value="'.esc_attr( $sub ).'"'.( $sub == $default ? ' selected="selected"' : '' ).'>'.esc_html( $subvalue ).'</option>';
|
443 |
-
}
|
444 |
-
|
445 |
-
echo '</optgroup>';
|
446 |
-
}
|
447 |
-
else
|
448 |
-
echo '<option value="'.esc_attr( $key ).'"'.( $key == $default ? ' selected="selected"' : '' ).'>'.esc_html( $value ).'</option>';
|
449 |
-
}
|
450 |
-
}
|
451 |
-
}
|
452 |
-
|
453 |
-
/**
|
454 |
-
* Expanded version of htmlspecialchars which detects the blog encoding and runs iconv on any encoding that is not supported by htmlspecialchars
|
455 |
-
*
|
456 |
-
* @param string $text Text to run htmlspecialchars on
|
457 |
-
* @return void
|
458 |
-
**/
|
459 |
-
function specialchars( $text ) {
|
460 |
-
$charset = get_option( 'blog_charset' );
|
461 |
-
|
462 |
-
if ( $charset != 'UTF-8' && function_exists( 'iconv' ) && !in_array( $charset, array( 'ISO-8859-1', 'ISO-8859-15', 'cp1251', 'cp1252', 'KOI8-R', 'BIG5', 'GB2312', 'Shift_JIS', 'EUC-JP' ) ) )
|
463 |
-
return iconv( 'UTF-8//IGNORE', $charset, htmlspecialchars( iconv( $charset, 'UTF-8//IGNORE', $text ) ) );
|
464 |
-
return htmlspecialchars( $text, ENT_COMPAT, $charset );
|
465 |
-
}
|
466 |
-
|
467 |
-
/**
|
468 |
-
* Special version of strlen that runs mb_strlen if blog encoding is not UTF-8
|
469 |
-
*
|
470 |
-
* @param string $name Name of your plugin. Is used to determine the plugin locale domain
|
471 |
-
* @param string $base Directory containing the plugin's 'view' files.
|
472 |
-
* @return void
|
473 |
-
**/
|
474 |
-
function strlen( $text ) {
|
475 |
-
$charset = get_option( 'blog_charset' );
|
476 |
-
|
477 |
-
if ( $charset != 'UTF-8' && function_exists( 'mb_strlen' ) )
|
478 |
-
return mb_strlen( $text );
|
479 |
-
return strlen( $text );
|
480 |
-
}
|
481 |
-
|
482 |
-
/**
|
483 |
-
* Returns version of plugin
|
484 |
-
*
|
485 |
-
* @return string Version
|
486 |
-
**/
|
487 |
-
function version() {
|
488 |
-
$plugin_data = implode( '', file( $this->plugin_base ) );
|
489 |
-
|
490 |
-
if ( preg_match( '|Version:(.*)|i', $plugin_data, $version ) )
|
491 |
-
return trim( $version[1] );
|
492 |
-
return '';
|
493 |
-
}
|
494 |
-
}
|
495 |
-
|
496 |
-
/**
|
497 |
-
* Debug helper, borrowed from CakePHP, that displays a print_r inside <pre></pre> tags
|
498 |
-
*
|
499 |
-
* @param string $name Name of your plugin. Is used to determine the plugin locale domain
|
500 |
-
* @param string $base Directory containing the plugin's 'view' files.
|
501 |
-
* @return void
|
502 |
-
**/
|
503 |
-
if ( !function_exists( 'pr' ) ) {
|
504 |
-
function pr( $thing ) {
|
505 |
-
echo '<pre>';
|
506 |
-
print_r( $thing );
|
507 |
-
echo '</pre>';
|
508 |
-
}
|
509 |
-
}
|
510 |
-
|
511 |
-
if ( !function_exists( '_n' ) ) {
|
512 |
-
function _n($single, $plural, $number, $domain = 'default') {
|
513 |
-
return __ngettext($single, $plural, $number, $domain = 'default');
|
514 |
-
}
|
515 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
readme.txt
CHANGED
@@ -3,14 +3,17 @@ Contributors: johnny5
|
|
3 |
Donate link: http://urbangiraffe.com/about/
|
4 |
Tags: post, admin, seo, pages, manage, 301, 404, redirect, permalink
|
5 |
Requires at least: 3.2
|
6 |
-
Tested up to: 4.
|
7 |
-
Stable tag: 2.3.
|
8 |
|
9 |
Redirection is a WordPress plugin to manage 301 redirections and keep track of 404 errors without requiring knowledge of Apache .htaccess files.
|
10 |
|
11 |
== Description ==
|
12 |
|
13 |
-
Redirection is a WordPress plugin to manage 301 redirections, keep track of 404 errors, and generally tidy up any loose ends your site may have.
|
|
|
|
|
|
|
14 |
|
15 |
New features include:
|
16 |
|
@@ -56,6 +59,7 @@ Redirection is available in:
|
|
56 |
* Belarusian, thanks to Alexander Ovsov
|
57 |
* Czech, thanks to Martin Jurica
|
58 |
* Danish, thanks to Rasmus Himmelstrup
|
|
|
59 |
|
60 |
Please submit bugs and patches to https://github.com/johngodley/redirection
|
61 |
|
@@ -90,6 +94,14 @@ The plugin works in a similar manner to how WordPress handles permalinks and sho
|
|
90 |
|
91 |
== Changelog ==
|
92 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
93 |
= 2.3.11 =
|
94 |
* Fix log cleanup options
|
95 |
* More space when editing redirects
|
3 |
Donate link: http://urbangiraffe.com/about/
|
4 |
Tags: post, admin, seo, pages, manage, 301, 404, redirect, permalink
|
5 |
Requires at least: 3.2
|
6 |
+
Tested up to: 4.2
|
7 |
+
Stable tag: 2.3.12
|
8 |
|
9 |
Redirection is a WordPress plugin to manage 301 redirections and keep track of 404 errors without requiring knowledge of Apache .htaccess files.
|
10 |
|
11 |
== Description ==
|
12 |
|
13 |
+
Redirection is a WordPress plugin to manage 301 redirections, keep track of 404 errors, and generally tidy up any loose ends your site may have.
|
14 |
+
This is particularly useful if you are migrating pages from an old website, or are changing the directory of your WordPress installation.
|
15 |
+
|
16 |
+
And it's 100% free!
|
17 |
|
18 |
New features include:
|
19 |
|
59 |
* Belarusian, thanks to Alexander Ovsov
|
60 |
* Czech, thanks to Martin Jurica
|
61 |
* Danish, thanks to Rasmus Himmelstrup
|
62 |
+
* Persian, thanks to Danial Hatami
|
63 |
|
64 |
Please submit bugs and patches to https://github.com/johngodley/redirection
|
65 |
|
94 |
|
95 |
== Changelog ==
|
96 |
|
97 |
+
= 2.3.12 =
|
98 |
+
* Persian translation by Danial Hatami
|
99 |
+
* Fix saving a redirection by login status, referrer, and user agent
|
100 |
+
* Fix problem where deleting your last group would cause Redirection to only show an error
|
101 |
+
* Add limits to referrer and destination in the logs
|
102 |
+
* Redirect title now shows in the main list again. The field is hidden when editing until toggled
|
103 |
+
* Fix 'bad nonce' error, props to Jonathan Harrell
|
104 |
+
|
105 |
= 2.3.11 =
|
106 |
* Fix log cleanup options
|
107 |
* More space when editing redirects
|
js/redirection.js → redirection.js
RENAMED
@@ -3,6 +3,12 @@ var Redirection;
|
|
3 |
(function($) {
|
4 |
Redirection_Items = function() {
|
5 |
function edit_items() {
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
$( 'table.items' ).on( 'click', '.row-actions a.red-auto', function( ev ) {
|
7 |
ev.preventDefault();
|
8 |
|
@@ -23,7 +29,7 @@ var Redirection;
|
|
23 |
|
24 |
$.post( ajaxurl, {
|
25 |
action: $( this ).data( 'action' ),
|
26 |
-
|
27 |
id: $( this ).data( 'id' )
|
28 |
}, function( response ) {
|
29 |
if ( show_error( response ) )
|
@@ -167,6 +173,7 @@ var Redirection;
|
|
167 |
success: function( response ) {
|
168 |
var error = get_redirect_error( response );
|
169 |
|
|
|
170 |
$( add_form ).removeClass( 'loading' );
|
171 |
|
172 |
if ( error ) {
|
3 |
(function($) {
|
4 |
Redirection_Items = function() {
|
5 |
function edit_items() {
|
6 |
+
$( 'table.items' ).on( 'click', '.advanced-toggle', function( ev ) {
|
7 |
+
ev.preventDefault();
|
8 |
+
$( this ).toggleClass( 'advanced-toggled' );
|
9 |
+
$( this ).closest( 'table' ).find( '.advanced' ).toggle();
|
10 |
+
} );
|
11 |
+
|
12 |
$( 'table.items' ).on( 'click', '.row-actions a.red-auto', function( ev ) {
|
13 |
ev.preventDefault();
|
14 |
|
29 |
|
30 |
$.post( ajaxurl, {
|
31 |
action: $( this ).data( 'action' ),
|
32 |
+
_ajax_nonce: $( this ).data( 'nonce' ),
|
33 |
id: $( this ).data( 'id' )
|
34 |
}, function( response ) {
|
35 |
if ( show_error( response ) )
|
173 |
success: function( response ) {
|
174 |
var error = get_redirect_error( response );
|
175 |
|
176 |
+
$( add_form ).find( 'input[type=text]' ).val( '' );
|
177 |
$( add_form ).removeClass( 'loading' );
|
178 |
|
179 |
if ( error ) {
|
redirection.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Redirection
|
4 |
Plugin URI: http://urbangiraffe.com/plugins/redirection/
|
5 |
Description: Manage all your 301 redirects and monitor 404 errors
|
6 |
-
Version: 2.3.
|
7 |
Author: John Godley
|
8 |
Author URI: http://urbangiraffe.com
|
9 |
============================================================================================================
|
@@ -19,7 +19,6 @@ For full license details see license.txt
|
|
19 |
============================================================================================================
|
20 |
*/
|
21 |
|
22 |
-
include dirname( __FILE__ ).'/plugin.php';
|
23 |
include dirname( __FILE__ ).'/models/redirect.php';
|
24 |
include dirname( __FILE__ ).'/models/match.php';
|
25 |
include dirname( __FILE__ ).'/models/log.php';
|
@@ -31,22 +30,18 @@ include dirname( __FILE__ ).'/modules/wordpress.php';
|
|
31 |
|
32 |
define( 'REDIRECTION_VERSION', '2.3.1' ); // DB schema version. Only change if DB needs changing
|
33 |
|
34 |
-
|
35 |
-
return;
|
36 |
-
|
37 |
-
class Redirection extends Redirection_Plugin {
|
38 |
var $hasMatched = false;
|
39 |
|
40 |
function __construct() {
|
41 |
-
$this->register_plugin( 'redirection', __FILE__ );
|
42 |
-
|
43 |
if ( is_admin() ) {
|
44 |
-
|
45 |
-
|
|
|
46 |
|
47 |
add_filter( 'set-screen-option', array( $this, 'set_per_page' ), 10, 3 );
|
48 |
|
49 |
-
|
50 |
|
51 |
add_action( 'wp_ajax_red_log_delete', array( &$this, 'ajax_log_delete' ) );
|
52 |
add_action( 'wp_ajax_red_module_edit', array( &$this, 'ajax_module_edit' ) );
|
@@ -68,7 +63,46 @@ class Redirection extends Redirection_Plugin {
|
|
68 |
add_action( 'redirection_log_delete', array( $this, 'expire_logs' ) );
|
69 |
|
70 |
$this->monitor = new Red_Monitor( $this->get_options() );
|
71 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
72 |
}
|
73 |
|
74 |
function update() {
|
@@ -84,6 +118,22 @@ class Redirection extends Redirection_Plugin {
|
|
84 |
return true;
|
85 |
}
|
86 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
87 |
function set_per_page( $status, $option, $value ) {
|
88 |
if ( $option == 'redirection_log_per_page' )
|
89 |
return $value;
|
@@ -91,20 +141,15 @@ class Redirection extends Redirection_Plugin {
|
|
91 |
}
|
92 |
|
93 |
function plugin_settings( $links ) {
|
94 |
-
$settings_link = '<a href="tools.php?page='.basename( __FILE__ ).'">'.__( 'Settings', 'redirection' ).'</a>';
|
95 |
array_unshift( $links, $settings_link );
|
96 |
return $links;
|
97 |
}
|
98 |
|
99 |
-
function version() {
|
100 |
-
$plugin_data = implode( '', file( __FILE__ ) );
|
101 |
-
|
102 |
-
if ( preg_match( '|Version:(.*)|i', $plugin_data, $version ) )
|
103 |
-
return trim( $version[1] );
|
104 |
-
return '';
|
105 |
-
}
|
106 |
-
|
107 |
function redirection_head() {
|
|
|
|
|
|
|
108 |
include dirname( __FILE__ ).'/models/pager.php';
|
109 |
|
110 |
$this->inject();
|
@@ -112,8 +157,8 @@ class Redirection extends Redirection_Plugin {
|
|
112 |
if ( !isset( $_GET['sub'] ) || ( isset( $_GET['sub'] ) && ( in_array( $_GET['sub'], array( 'log', '404s', 'groups' ) ) ) ) )
|
113 |
add_screen_option( 'per_page', array( 'label' => __( 'Log entries', 'redirection' ), 'default' => 25, 'option' => 'redirection_log_per_page' ) );
|
114 |
|
115 |
-
wp_enqueue_script( 'redirection', plugin_dir_url( __FILE__ ).'
|
116 |
-
wp_enqueue_style( 'redirection', plugin_dir_url( __FILE__ ).'admin.css', $
|
117 |
|
118 |
wp_localize_script( 'redirection', 'Redirectioni10n', array(
|
119 |
'error_msg' => __( 'Sorry, unable to do that. Please try refreshing the page.' ),
|
@@ -139,7 +184,6 @@ class Redirection extends Redirection_Plugin {
|
|
139 |
|
140 |
if ( $options['expire_404'] > 0 ) {
|
141 |
$cleanup = true;
|
142 |
-
echo $wpdb->prepare( "SELECT COUNT(*) FROM {$wpdb->prefix}redirection_404 WHERE created < DATE_SUB(NOW(), INTERVAL %d DAY)", $options['expire_404'] );
|
143 |
$l404 = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM {$wpdb->prefix}redirection_404 WHERE created < DATE_SUB(NOW(), INTERVAL %d DAY)", $options['expire_404'] ) );
|
144 |
|
145 |
if ( $l404 > 0 )
|
@@ -177,7 +221,7 @@ class Redirection extends Redirection_Plugin {
|
|
177 |
elseif ( $_GET['sub'] == 'modules' )
|
178 |
return $this->admin_screen_modules();
|
179 |
elseif ( $_GET['sub'] == 'support' )
|
180 |
-
return $this->
|
181 |
}
|
182 |
|
183 |
return $this->admin_redirects( isset( $_GET['id'] ) ? intval( $_GET['id'] ) : 0 );
|
@@ -188,7 +232,7 @@ class Redirection extends Redirection_Plugin {
|
|
188 |
$pager = new Redirection_Module_Table( $options['token'] );
|
189 |
$pager->prepare_items();
|
190 |
|
191 |
-
$this->
|
192 |
}
|
193 |
|
194 |
function get_options() {
|
@@ -302,7 +346,7 @@ class Redirection extends Redirection_Plugin {
|
|
302 |
}
|
303 |
|
304 |
$groups = Red_Group::get_for_select();
|
305 |
-
$this->
|
306 |
}
|
307 |
|
308 |
function admin_screen_log() {
|
@@ -324,7 +368,7 @@ class Redirection extends Redirection_Plugin {
|
|
324 |
else
|
325 |
$table->prepare_items();
|
326 |
|
327 |
-
$this->
|
328 |
}
|
329 |
|
330 |
function admin_screen_404() {
|
@@ -338,7 +382,7 @@ class Redirection extends Redirection_Plugin {
|
|
338 |
$table = new Redirection_404_Table( $options );
|
339 |
$table->prepare_items( isset( $_GET['ip'] ) ? $_GET['ip'] : false );
|
340 |
|
341 |
-
$this->
|
342 |
}
|
343 |
|
344 |
function admin_groups( $module ) {
|
@@ -359,7 +403,7 @@ class Redirection extends Redirection_Plugin {
|
|
359 |
|
360 |
$module = Red_Module::get( $module );
|
361 |
if ( $module )
|
362 |
-
$this->
|
363 |
else
|
364 |
$this->render_message( __( 'Unknown module', 'redirection' ) );
|
365 |
}
|
@@ -370,14 +414,13 @@ class Redirection extends Redirection_Plugin {
|
|
370 |
|
371 |
$group = Red_Group::get( $group_id );
|
372 |
if ( $group === false ) {
|
373 |
-
$
|
374 |
}
|
375 |
-
else {
|
376 |
-
$table = new Redirection_Table( Red_Group::get_for_select(), $group );
|
377 |
-
$table->prepare_items();
|
378 |
|
379 |
-
|
380 |
-
|
|
|
|
|
381 |
}
|
382 |
|
383 |
function setMatched( $match ) {
|
@@ -431,7 +474,7 @@ class Redirection extends Redirection_Plugin {
|
|
431 |
}
|
432 |
|
433 |
private function check_ajax_referer( $nonce ) {
|
434 |
-
if ( check_ajax_referer( $nonce,
|
435 |
$this->output_ajax_response( array( 'error' => __( 'Unable to perform action' ).' - bad nonce' ) );
|
436 |
}
|
437 |
|
@@ -442,7 +485,7 @@ class Redirection extends Redirection_Plugin {
|
|
442 |
|
443 |
$module = Red_Module::get( $module_id );
|
444 |
if ( $module )
|
445 |
-
$json['html'] = $this->
|
446 |
else
|
447 |
$json['error'] = __( 'Unable to perform action' ).' - could not find module';
|
448 |
|
@@ -481,7 +524,7 @@ class Redirection extends Redirection_Plugin {
|
|
481 |
|
482 |
$group = Red_Group::get( $group_id );
|
483 |
if ( $group )
|
484 |
-
$json['html'] = $this->
|
485 |
else
|
486 |
$json['error'] = __( 'Unable to perform action' ).' - could not find group';
|
487 |
|
@@ -516,7 +559,7 @@ class Redirection extends Redirection_Plugin {
|
|
516 |
$redirect = Red_Item::get_by_id( intval( $_POST['id'] ) );
|
517 |
|
518 |
if ( $redirect )
|
519 |
-
$json['html'] = $this->
|
520 |
else
|
521 |
$json['error'] = __( 'Unable to perform action' ).' - could not find redirect';
|
522 |
|
3 |
Plugin Name: Redirection
|
4 |
Plugin URI: http://urbangiraffe.com/plugins/redirection/
|
5 |
Description: Manage all your 301 redirects and monitor 404 errors
|
6 |
+
Version: 2.3.12
|
7 |
Author: John Godley
|
8 |
Author URI: http://urbangiraffe.com
|
9 |
============================================================================================================
|
19 |
============================================================================================================
|
20 |
*/
|
21 |
|
|
|
22 |
include dirname( __FILE__ ).'/models/redirect.php';
|
23 |
include dirname( __FILE__ ).'/models/match.php';
|
24 |
include dirname( __FILE__ ).'/models/log.php';
|
30 |
|
31 |
define( 'REDIRECTION_VERSION', '2.3.1' ); // DB schema version. Only change if DB needs changing
|
32 |
|
33 |
+
class Redirection {
|
|
|
|
|
|
|
34 |
var $hasMatched = false;
|
35 |
|
36 |
function __construct() {
|
|
|
|
|
37 |
if ( is_admin() ) {
|
38 |
+
add_action( 'admin_menu', array( &$this, 'admin_menu' ) );
|
39 |
+
add_action( 'init', array( &$this, 'init' ) );
|
40 |
+
add_action( 'load-tools_page_redirection', array( &$this, 'redirection_head' ) );
|
41 |
|
42 |
add_filter( 'set-screen-option', array( $this, 'set_per_page' ), 10, 3 );
|
43 |
|
44 |
+
add_action( 'plugin_action_links_'.basename( dirname( __FILE__ ) ).'/'.basename( __FILE__ ), array( &$this, 'plugin_settings' ), 10, 4 );
|
45 |
|
46 |
add_action( 'wp_ajax_red_log_delete', array( &$this, 'ajax_log_delete' ) );
|
47 |
add_action( 'wp_ajax_red_module_edit', array( &$this, 'ajax_module_edit' ) );
|
63 |
add_action( 'redirection_log_delete', array( $this, 'expire_logs' ) );
|
64 |
|
65 |
$this->monitor = new Red_Monitor( $this->get_options() );
|
66 |
+
add_action( 'template_redirect', array( &$this, 'template_redirect' ) );
|
67 |
+
}
|
68 |
+
|
69 |
+
public function init() {
|
70 |
+
load_plugin_textdomain( 'redirection', false, dirname( plugin_basename( __FILE__ ) ).'/locale/' );
|
71 |
+
}
|
72 |
+
|
73 |
+
private function render( $template, $template_vars = array() ) {
|
74 |
+
foreach ( $template_vars AS $key => $val ) {
|
75 |
+
$$key = $val;
|
76 |
+
}
|
77 |
+
|
78 |
+
if ( file_exists( dirname( __FILE__ )."/view/admin/$template.php" ) )
|
79 |
+
include dirname( __FILE__ )."/view/admin/$template.php";
|
80 |
+
}
|
81 |
+
|
82 |
+
private function capture( $ug_name, $ug_vars = array() ) {
|
83 |
+
ob_start();
|
84 |
+
|
85 |
+
$this->render( $ug_name, $ug_vars );
|
86 |
+
$output = ob_get_contents();
|
87 |
+
|
88 |
+
ob_end_clean();
|
89 |
+
return $output;
|
90 |
+
}
|
91 |
+
|
92 |
+
private function render_error( $message ) {
|
93 |
+
?>
|
94 |
+
<div class="fade error" id="message">
|
95 |
+
<p><?php echo $message ?></p>
|
96 |
+
</div>
|
97 |
+
<?php
|
98 |
+
}
|
99 |
+
|
100 |
+
private function render_message( $message, $timeout = 0 ) {
|
101 |
+
?>
|
102 |
+
<div class="updated" id="message" onclick="this.parentNode.removeChild(this)">
|
103 |
+
<p><?php echo $message ?></p>
|
104 |
+
</div>
|
105 |
+
<?php
|
106 |
}
|
107 |
|
108 |
function update() {
|
118 |
return true;
|
119 |
}
|
120 |
|
121 |
+
private function select( $items, $default = '' ) {
|
122 |
+
foreach ( $items AS $key => $value ) {
|
123 |
+
if ( is_array( $value ) ) {
|
124 |
+
echo '<optgroup label="'.esc_attr( $key ).'">';
|
125 |
+
|
126 |
+
foreach ( $value AS $sub => $subvalue ) {
|
127 |
+
echo '<option value="'.esc_attr( $sub ).'"'.( $sub == $default ? ' selected="selected"' : '' ).'>'.esc_html( $subvalue ).'</option>';
|
128 |
+
}
|
129 |
+
|
130 |
+
echo '</optgroup>';
|
131 |
+
}
|
132 |
+
else
|
133 |
+
echo '<option value="'.esc_attr( $key ).'"'.( $key == $default ? ' selected="selected"' : '' ).'>'.esc_html( $value ).'</option>';
|
134 |
+
}
|
135 |
+
}
|
136 |
+
|
137 |
function set_per_page( $status, $option, $value ) {
|
138 |
if ( $option == 'redirection_log_per_page' )
|
139 |
return $value;
|
141 |
}
|
142 |
|
143 |
function plugin_settings( $links ) {
|
144 |
+
$settings_link = '<a href="tools.php?page='.basename( __FILE__ ).'&sub=options">'.__( 'Settings', 'redirection' ).'</a>';
|
145 |
array_unshift( $links, $settings_link );
|
146 |
return $links;
|
147 |
}
|
148 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
149 |
function redirection_head() {
|
150 |
+
$version = get_plugin_data( __FILE__ );
|
151 |
+
$version = $version['Version'];
|
152 |
+
|
153 |
include dirname( __FILE__ ).'/models/pager.php';
|
154 |
|
155 |
$this->inject();
|
157 |
if ( !isset( $_GET['sub'] ) || ( isset( $_GET['sub'] ) && ( in_array( $_GET['sub'], array( 'log', '404s', 'groups' ) ) ) ) )
|
158 |
add_screen_option( 'per_page', array( 'label' => __( 'Log entries', 'redirection' ), 'default' => 25, 'option' => 'redirection_log_per_page' ) );
|
159 |
|
160 |
+
wp_enqueue_script( 'redirection', plugin_dir_url( __FILE__ ).'redirection.js', array( 'jquery-form', 'jquery-ui-sortable' ), $version );
|
161 |
+
wp_enqueue_style( 'redirection', plugin_dir_url( __FILE__ ).'admin.css', $version );
|
162 |
|
163 |
wp_localize_script( 'redirection', 'Redirectioni10n', array(
|
164 |
'error_msg' => __( 'Sorry, unable to do that. Please try refreshing the page.' ),
|
184 |
|
185 |
if ( $options['expire_404'] > 0 ) {
|
186 |
$cleanup = true;
|
|
|
187 |
$l404 = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM {$wpdb->prefix}redirection_404 WHERE created < DATE_SUB(NOW(), INTERVAL %d DAY)", $options['expire_404'] ) );
|
188 |
|
189 |
if ( $l404 > 0 )
|
221 |
elseif ( $_GET['sub'] == 'modules' )
|
222 |
return $this->admin_screen_modules();
|
223 |
elseif ( $_GET['sub'] == 'support' )
|
224 |
+
return $this->render('support', array( 'options' => $this->get_options() ) );
|
225 |
}
|
226 |
|
227 |
return $this->admin_redirects( isset( $_GET['id'] ) ? intval( $_GET['id'] ) : 0 );
|
232 |
$pager = new Redirection_Module_Table( $options['token'] );
|
233 |
$pager->prepare_items();
|
234 |
|
235 |
+
$this->render( 'module_list', array( 'options' => $options, 'table' => $pager ) );
|
236 |
}
|
237 |
|
238 |
function get_options() {
|
346 |
}
|
347 |
|
348 |
$groups = Red_Group::get_for_select();
|
349 |
+
$this->render( 'options', array( 'options' => $this->get_options(), 'groups' => $groups ) );
|
350 |
}
|
351 |
|
352 |
function admin_screen_log() {
|
368 |
else
|
369 |
$table->prepare_items();
|
370 |
|
371 |
+
$this->render( 'log', array( 'options' => $options, 'table' => $table, 'lookup' => $options['lookup'], 'type' => 'log' ) );
|
372 |
}
|
373 |
|
374 |
function admin_screen_404() {
|
382 |
$table = new Redirection_404_Table( $options );
|
383 |
$table->prepare_items( isset( $_GET['ip'] ) ? $_GET['ip'] : false );
|
384 |
|
385 |
+
$this->render( 'log', array( 'options' => $options, 'table' => $table, 'lookup' => $options['lookup'], 'type' => '404s' ) );
|
386 |
}
|
387 |
|
388 |
function admin_groups( $module ) {
|
403 |
|
404 |
$module = Red_Module::get( $module );
|
405 |
if ( $module )
|
406 |
+
$this->render( 'group_list', array( 'options' => $this->get_options(), 'table' => $table, 'modules' => Red_Module::get_for_select(), 'module' => $module ) );
|
407 |
else
|
408 |
$this->render_message( __( 'Unknown module', 'redirection' ) );
|
409 |
}
|
414 |
|
415 |
$group = Red_Group::get( $group_id );
|
416 |
if ( $group === false ) {
|
417 |
+
$group = Red_Group::create( array( 'name' => 'Redirections', 'module_id' => 1 ) );
|
418 |
}
|
|
|
|
|
|
|
419 |
|
420 |
+
$table = new Redirection_Table( Red_Group::get_for_select(), $group );
|
421 |
+
$table->prepare_items();
|
422 |
+
|
423 |
+
$this->render( 'item_list', array( 'options' => $this->get_options(), 'group' => $group, 'table' => $table, 'date_format' => get_option( 'date_format' ) ) );
|
424 |
}
|
425 |
|
426 |
function setMatched( $match ) {
|
474 |
}
|
475 |
|
476 |
private function check_ajax_referer( $nonce ) {
|
477 |
+
if ( check_ajax_referer( $nonce, false, false ) === false )
|
478 |
$this->output_ajax_response( array( 'error' => __( 'Unable to perform action' ).' - bad nonce' ) );
|
479 |
}
|
480 |
|
485 |
|
486 |
$module = Red_Module::get( $module_id );
|
487 |
if ( $module )
|
488 |
+
$json['html'] = $this->capture( 'module_edit', array( 'module' => $module ) );
|
489 |
else
|
490 |
$json['error'] = __( 'Unable to perform action' ).' - could not find module';
|
491 |
|
524 |
|
525 |
$group = Red_Group::get( $group_id );
|
526 |
if ( $group )
|
527 |
+
$json['html'] = $this->capture( 'group_edit', array( 'group' => $group, 'modules' => Red_Module::get_for_select() ) );
|
528 |
else
|
529 |
$json['error'] = __( 'Unable to perform action' ).' - could not find group';
|
530 |
|
559 |
$redirect = Red_Item::get_by_id( intval( $_POST['id'] ) );
|
560 |
|
561 |
if ( $redirect )
|
562 |
+
$json['html'] = $this->capture( 'item_edit', array( 'redirect' => $redirect, 'groups' => Red_Group::get_for_select() ) );
|
563 |
else
|
564 |
$json['error'] = __( 'Unable to perform action' ).' - could not find redirect';
|
565 |
|
view/admin/add.php
CHANGED
@@ -47,7 +47,7 @@
|
|
47 |
<?php endif; ?>
|
48 |
|
49 |
<input type="hidden" name="action" value="red_redirect_add"/>
|
50 |
-
|
51 |
|
52 |
<div class="red-error"></div>
|
53 |
</td>
|
47 |
<?php endif; ?>
|
48 |
|
49 |
<input type="hidden" name="action" value="red_redirect_add"/>
|
50 |
+
<?php wp_nonce_field( 'redirection-redirect_add' ) ?>
|
51 |
|
52 |
<div class="red-error"></div>
|
53 |
</td>
|
view/admin/group_edit.php
CHANGED
@@ -6,7 +6,7 @@
|
|
6 |
</tr>
|
7 |
<tr>
|
8 |
<th width="70"><?php _e ('Tracked', 'redirection'); ?>:</th>
|
9 |
-
<td><label><input type="checkbox" name="tracking"<?php echo
|
10 |
</tr>
|
11 |
<tr>
|
12 |
<th width="70"><?php _e ('Enabled', 'redirection'); ?>:</th>
|
@@ -21,7 +21,7 @@
|
|
21 |
|
22 |
<input type="hidden" name="action" value="red_group_save"/>
|
23 |
<input type="hidden" name="id" value="<?php echo esc_attr( $group->id ); ?>"/>
|
24 |
-
|
25 |
</div>
|
26 |
|
27 |
<div class="table-loading">
|
6 |
</tr>
|
7 |
<tr>
|
8 |
<th width="70"><?php _e ('Tracked', 'redirection'); ?>:</th>
|
9 |
+
<td><label><input type="checkbox" name="tracking"<?php echo checked ($group->tracking) ?>/> <span class="sub"><?php _e ('Whether to track \'hits\' to items', 'redirection'); ?></span></label></td>
|
10 |
</tr>
|
11 |
<tr>
|
12 |
<th width="70"><?php _e ('Enabled', 'redirection'); ?>:</th>
|
21 |
|
22 |
<input type="hidden" name="action" value="red_group_save"/>
|
23 |
<input type="hidden" name="id" value="<?php echo esc_attr( $group->id ); ?>"/>
|
24 |
+
<?php wp_nonce_field( 'redirection-group_save_'.$group->id ) ?>
|
25 |
</div>
|
26 |
|
27 |
<div class="table-loading">
|
view/admin/group_list.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
|
5 |
<h2><?php _e( 'Groups', 'redirection' ); ?></a></h2>
|
6 |
|
7 |
-
<?php $this->
|
8 |
|
9 |
<form action="tools.php">
|
10 |
<input type="hidden" name="page" value="redirection.php"/>
|
4 |
|
5 |
<h2><?php _e( 'Groups', 'redirection' ); ?></a></h2>
|
6 |
|
7 |
+
<?php $this->render( 'submenu', array( 'options' => $options ) ); ?>
|
8 |
|
9 |
<form action="tools.php">
|
10 |
<input type="hidden" name="page" value="redirection.php"/>
|
view/admin/item_edit.php
CHANGED
@@ -1,18 +1,19 @@
|
|
1 |
<?php if ( !defined( 'ABSPATH' ) ) die( 'No direct access allowed' ); ?>
|
2 |
<table class="edit" data-url="<?php echo admin_url( 'admin-ajax.php' ) ?>">
|
3 |
-
<tr>
|
4 |
-
<th width="100"><?php _e ('Description', 'redirection'); ?>:</th>
|
5 |
-
<td>
|
6 |
-
<input style="width: 85%" type="text" name="title" value="<?php echo esc_attr( $redirect->title ); ?>"/>
|
7 |
-
<span class="sub">(<?php _e( "optional", 'redirection' ); ?>)</span>
|
8 |
-
</td>
|
9 |
-
</tr>
|
10 |
-
|
11 |
<tr>
|
12 |
<th width="100"><a target="_blank" href="<?php echo esc_url( $redirect->url ) ?>"><?php _e( 'Source URL', 'redirection' ); ?>:</a></th>
|
13 |
<td>
|
14 |
<input style="width: 85%" type="text" name="old" value="<?php echo esc_attr( $redirect->url ); ?>" id="original"/>
|
15 |
<label><?php _e( 'Regex', 'redirection' ); ?>: <input type="checkbox" name="regex" <?php if ( $redirect->regex == true ) echo ' checked="checked"' ?>/></label>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
</td>
|
17 |
</tr>
|
18 |
|
@@ -27,7 +28,7 @@
|
|
27 |
|
28 |
<input type="hidden" name="action" value="red_redirect_save"/>
|
29 |
<input type="hidden" name="id" value="<?php echo esc_attr( $redirect->id ); ?>"/>
|
30 |
-
|
31 |
|
32 |
<span id="info_<?php echo esc_attr( $redirect->id ) ?>"></span>
|
33 |
</div>
|
1 |
<?php if ( !defined( 'ABSPATH' ) ) die( 'No direct access allowed' ); ?>
|
2 |
<table class="edit" data-url="<?php echo admin_url( 'admin-ajax.php' ) ?>">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
<tr>
|
4 |
<th width="100"><a target="_blank" href="<?php echo esc_url( $redirect->url ) ?>"><?php _e( 'Source URL', 'redirection' ); ?>:</a></th>
|
5 |
<td>
|
6 |
<input style="width: 85%" type="text" name="old" value="<?php echo esc_attr( $redirect->url ); ?>" id="original"/>
|
7 |
<label><?php _e( 'Regex', 'redirection' ); ?>: <input type="checkbox" name="regex" <?php if ( $redirect->regex == true ) echo ' checked="checked"' ?>/></label>
|
8 |
+
|
9 |
+
<a href="#" class="advanced-toggle">⚙</a>
|
10 |
+
</td>
|
11 |
+
</tr>
|
12 |
+
<tr class="advanced">
|
13 |
+
<th width="100"><?php _e ('Description', 'redirection'); ?>:</th>
|
14 |
+
<td>
|
15 |
+
<input style="width: 85%" type="text" name="title" value="<?php echo esc_attr( $redirect->title ); ?>"/>
|
16 |
+
<span class="sub">(<?php _e( "optional", 'redirection' ); ?>)</span>
|
17 |
</td>
|
18 |
</tr>
|
19 |
|
28 |
|
29 |
<input type="hidden" name="action" value="red_redirect_save"/>
|
30 |
<input type="hidden" name="id" value="<?php echo esc_attr( $redirect->id ); ?>"/>
|
31 |
+
<?php wp_nonce_field( 'redirection-redirect_save_'.$redirect->id ) ?>
|
32 |
|
33 |
<span id="info_<?php echo esc_attr( $redirect->id ) ?>"></span>
|
34 |
</div>
|
view/admin/item_list.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
|
5 |
<h2><?php _e( 'Redirections', 'redirection' ); ?>:</h2>
|
6 |
|
7 |
-
<?php $this->
|
8 |
|
9 |
<form action="tools.php">
|
10 |
<input type="hidden" name="page" value="redirection.php"/>
|
@@ -19,7 +19,7 @@
|
|
19 |
<div style="clear: both"></div>
|
20 |
</div>
|
21 |
|
22 |
-
<?php $this->
|
23 |
|
24 |
<script type="text/javascript">
|
25 |
var redirection;
|
4 |
|
5 |
<h2><?php _e( 'Redirections', 'redirection' ); ?>:</h2>
|
6 |
|
7 |
+
<?php $this->render( 'submenu', array( 'options' => $options ) ); ?>
|
8 |
|
9 |
<form action="tools.php">
|
10 |
<input type="hidden" name="page" value="redirection.php"/>
|
19 |
<div style="clear: both"></div>
|
20 |
</div>
|
21 |
|
22 |
+
<?php $this->render( 'add', array( 'add_to_screen' => true, 'group' => $group ? $group->id : 0, 'hidden' => false ) ); ?>
|
23 |
|
24 |
<script type="text/javascript">
|
25 |
var redirection;
|
view/admin/log.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
|
5 |
<h2><?php _e ('Redirection Log', 'redirection'); ?></h2>
|
6 |
|
7 |
-
<?php $this->
|
8 |
|
9 |
<form action="tools.php">
|
10 |
<input type="hidden" name="page" value="redirection.php"/>
|
@@ -32,7 +32,7 @@
|
|
32 |
<div style="clear: both"></div>
|
33 |
</div>
|
34 |
|
35 |
-
<?php $this->
|
36 |
|
37 |
<script type="text/javascript">
|
38 |
var redirection;
|
4 |
|
5 |
<h2><?php _e ('Redirection Log', 'redirection'); ?></h2>
|
6 |
|
7 |
+
<?php $this->render( 'submenu', array( 'options' => $options ) ); ?>
|
8 |
|
9 |
<form action="tools.php">
|
10 |
<input type="hidden" name="page" value="redirection.php"/>
|
32 |
<div style="clear: both"></div>
|
33 |
</div>
|
34 |
|
35 |
+
<?php $this->render ('add', array ('hidden' => true))?>
|
36 |
|
37 |
<script type="text/javascript">
|
38 |
var redirection;
|
view/admin/module_edit.php
CHANGED
@@ -16,7 +16,7 @@
|
|
16 |
|
17 |
<input type="hidden" name="action" value="red_module_save"/>
|
18 |
<input type="hidden" name="id" value="<?php echo esc_attr( $module->get_id() ); ?>"/>
|
19 |
-
|
20 |
</div>
|
21 |
|
22 |
<div class="table-loading">
|
16 |
|
17 |
<input type="hidden" name="action" value="red_module_save"/>
|
18 |
<input type="hidden" name="id" value="<?php echo esc_attr( $module->get_id() ); ?>"/>
|
19 |
+
<?php wp_nonce_field( 'red_module_save_'.$module->get_id() ) ?>
|
20 |
</div>
|
21 |
|
22 |
<div class="table-loading">
|
view/admin/module_list.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
|
5 |
<h2><?php _e( 'Modules', 'redirection' ); ?></h2>
|
6 |
|
7 |
-
<?php $this->
|
8 |
|
9 |
<form method="POST" action="">
|
10 |
<?php $table->display(); ?>
|
4 |
|
5 |
<h2><?php _e( 'Modules', 'redirection' ); ?></h2>
|
6 |
|
7 |
+
<?php $this->render( 'submenu', array( 'options' => $options ) ); ?>
|
8 |
|
9 |
<form method="POST" action="">
|
10 |
<?php $table->display(); ?>
|
view/admin/options.php
CHANGED
@@ -17,7 +17,7 @@ $expiry = array(
|
|
17 |
<?php screen_icon( ); ?>
|
18 |
|
19 |
<h2><?php _e( 'Options', 'redirection' ) ?></h2>
|
20 |
-
<?php $this->
|
21 |
|
22 |
<form method="post" action="">
|
23 |
<?php wp_nonce_field( 'redirection-update_options' ); ?>
|
17 |
<?php screen_icon( ); ?>
|
18 |
|
19 |
<h2><?php _e( 'Options', 'redirection' ) ?></h2>
|
20 |
+
<?php $this->render( 'submenu', array( 'options' => $options ) ); ?>
|
21 |
|
22 |
<form method="post" action="">
|
23 |
<?php wp_nonce_field( 'redirection-update_options' ); ?>
|
view/admin/support.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
<?php screen_icon(); ?>
|
4 |
|
5 |
<h2><?php _e ('Redirection Support', 'redirection'); ?></h2>
|
6 |
-
<?php $this->
|
7 |
|
8 |
<p style="clear: both">
|
9 |
<?php _e( 'Redirection is free to use - life is wonderful and lovely! However, it has required a great deal of time and effort to develop and if it has been useful you can help support this development by <strong>making a small donation</strong>.', 'redirection'); ?>
|
3 |
<?php screen_icon(); ?>
|
4 |
|
5 |
<h2><?php _e ('Redirection Support', 'redirection'); ?></h2>
|
6 |
+
<?php $this->render( 'submenu', array( 'options' => $options ) ); ?>
|
7 |
|
8 |
<p style="clear: both">
|
9 |
<?php _e( 'Redirection is free to use - life is wonderful and lovely! However, it has required a great deal of time and effort to develop and if it has been useful you can help support this development by <strong>making a small donation</strong>.', 'redirection'); ?>
|