WP Rollback - Version 1.4

Version Description

  • New: Updated plugin's text domain to the plugin's slug of 'wp-rollback' to support WordPress' GlotPress translations - https://github.com/WordImpress/WP-Rollback/issues/28
  • New: Gulp automated POT file generation and text domain checker - https://github.com/WordImpress/WP-Rollback/issues/28
  • Fix: Check the WP install's themes transient is present, if not fetch it to see if a theme can be rolled back. Allows rollbacks for new WP installs or in a case where the transient is not set properly - https://github.com/WordImpress/WP-Rollback/issues/27
Download this release

Release Info

Developer dlocc
Plugin Icon 128x128 WP Rollback
Version 1.4
Comparing to
See all releases

Code changes from version 1.3 to 1.4

assets/css/wp-rollback.css CHANGED
@@ -1,104 +1,104 @@
1
- /**
2
- * WP Rollback Styles
3
- */
4
-
5
- .wpr-content-wrap {
6
- max-width: 805px;
7
- }
8
-
9
- .wpr-content-wrap h1 {
10
- padding: 0 0 15px 0;
11
- }
12
-
13
- .wpr-content-wrap h1 img {
14
- width: 40px;
15
- position: relative;
16
- top: 11px;
17
- margin-right: 10px;
18
- }
19
-
20
- .wpr-content-wrap p {
21
- font-size: 18px;
22
- margin-top: 10px;
23
- }
24
-
25
- .wpr-content-wrap p span {
26
- font-style: italic;
27
- color: #000;
28
- font-weight: 600;
29
- }
30
-
31
- .rollback-form {
32
-
33
- }
34
-
35
- .wpr-versions-wrap {
36
- padding-left: 20px;
37
- }
38
-
39
- .rollback-form label {
40
- display: block;
41
- padding: 8px 0;
42
- font-size: 16px;
43
- }
44
-
45
- .rollback-form label input {
46
- margin-right: 5px;
47
- }
48
-
49
- .wpr-submit-wrap {
50
- margin: 25px 0 0;
51
- border-top: 1px solid #DADADA;
52
- padding: 20px 0 30px;
53
- max-width: 765px;
54
- }
55
-
56
- .rollback-form .current-version {
57
- text-transform: lowercase;
58
- font-size: 12px;
59
- font-style: italic;
60
- color: #AEAEAE;
61
- margin-left: 14px;
62
- }
63
-
64
- .wpr-selected {
65
- font-weight: bold;
66
- }
67
-
68
- .wpr-rollback-disabled.magnific-popup.button-primary {
69
- opacity: 0.6;
70
- cursor: default;
71
- }
72
-
73
- .button-primary {
74
- margin-right: 5px !important;
75
- }
76
-
77
- /* Modal */
78
-
79
- #wpr-modal-confirm {
80
-
81
- }
82
-
83
- #wpr-modal-confirm .button-primary {
84
- margin-right: 5px;
85
- }
86
-
87
- .wpr-error {
88
- background: #fff;
89
- border-left: 4px solid #FFB800;
90
- -webkit-box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.1);
91
- box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.1);
92
- margin: 20px 0;
93
- padding: 1px 12px;
94
- }
95
-
96
- .wpr-error p {
97
- margin: 0.5em 0;
98
- padding: 2px;
99
- }
100
-
101
- .wpr-rollback-intro {
102
- font-size: 18px;
103
- margin-top: 0;
104
  }
1
+ /**
2
+ * WP Rollback Styles
3
+ */
4
+
5
+ .wpr-content-wrap {
6
+ max-width: 805px;
7
+ }
8
+
9
+ .wpr-content-wrap h1 {
10
+ padding: 0 0 15px 0;
11
+ }
12
+
13
+ .wpr-content-wrap h1 img {
14
+ width: 40px;
15
+ position: relative;
16
+ top: 11px;
17
+ margin-right: 10px;
18
+ }
19
+
20
+ .wpr-content-wrap p {
21
+ font-size: 18px;
22
+ margin-top: 10px;
23
+ }
24
+
25
+ .wpr-content-wrap p span {
26
+ font-style: italic;
27
+ color: #000;
28
+ font-weight: 600;
29
+ }
30
+
31
+ .rollback-form {
32
+
33
+ }
34
+
35
+ .wpr-versions-wrap {
36
+ padding-left: 20px;
37
+ }
38
+
39
+ .rollback-form label {
40
+ display: block;
41
+ padding: 8px 0;
42
+ font-size: 16px;
43
+ }
44
+
45
+ .rollback-form label input {
46
+ margin-right: 5px;
47
+ }
48
+
49
+ .wpr-submit-wrap {
50
+ margin: 25px 0 0;
51
+ border-top: 1px solid #DADADA;
52
+ padding: 20px 0 30px;
53
+ max-width: 765px;
54
+ }
55
+
56
+ .rollback-form .current-version {
57
+ text-transform: lowercase;
58
+ font-size: 12px;
59
+ font-style: italic;
60
+ color: #AEAEAE;
61
+ margin-left: 14px;
62
+ }
63
+
64
+ .wpr-selected {
65
+ font-weight: bold;
66
+ }
67
+
68
+ .wpr-rollback-disabled.magnific-popup.button-primary {
69
+ opacity: 0.6;
70
+ cursor: default;
71
+ }
72
+
73
+ .button-primary {
74
+ margin-right: 5px !important;
75
+ }
76
+
77
+ /* Modal */
78
+
79
+ #wpr-modal-confirm {
80
+
81
+ }
82
+
83
+ #wpr-modal-confirm .button-primary {
84
+ margin-right: 5px;
85
+ }
86
+
87
+ .wpr-error {
88
+ background: #fff;
89
+ border-left: 4px solid #FFB800;
90
+ -webkit-box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.1);
91
+ box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.1);
92
+ margin: 20px 0;
93
+ padding: 1px 12px;
94
+ }
95
+
96
+ .wpr-error p {
97
+ margin: 0.5em 0;
98
+ padding: 2px;
99
+ }
100
+
101
+ .wpr-rollback-intro {
102
+ font-size: 18px;
103
+ margin-top: 0;
104
  }
assets/images/wprb-icon-final.svg CHANGED
@@ -1,33 +1,33 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
- <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
- <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
5
- width="89.23px" height="100px" viewBox="0 0 89.23 100" enable-background="new 0 0 89.23 100" xml:space="preserve">
6
- <path fill="#464342" d="M16.196,68.183c-1.398,0.656-1.515,0.518-3.173,1.23c1.898,4.219,4.532,7.676,7.89,10.79
7
- c0.578-0.766,1.33-1.663,1.987-2.611C20.031,74.901,17.825,71.949,16.196,68.183z"/>
8
- <path fill="#464342" d="M44.213,21.495c-18.771,0-34.042,15.27-34.042,34.041c0,3.354,0.573,6.886,1.481,9.949
9
- c0.961-0.427,1.881-0.604,3.26-1.188l-1.306-8.762c-0.054-3.254,0.952-8.649,2.65-12.456l14.6,40
10
- c-1.733-0.843-3.118-1.677-4.625-2.782c-0.73,1.015-0.974,1.19-2.079,2.646c5.1,3.763,11.132,6.162,17.822,6.579
11
- c0-0.84,0-2.406,0-3.466c-2.259-0.155-4.31-0.544-6.409-1.161l9.184-26.683l9.406,25.773c0.063,0.151,0.139,0.289,0.22,0.422
12
- c-2.61,0.918-5.382,1.49-8.26,1.669V86.5c0,1.084,0,1.935,0,3.022c17.887-0.991,32.139-15.855,32.139-33.987
13
- C78.254,36.765,62.982,21.495,44.213,21.495z M48.431,41.185c1.841-0.097,3.503-0.29,3.503-0.29
14
- c1.646-0.196,1.454-2.619-0.195-2.523c0,0-4.958,0.389-8.16,0.389c-3.006,0-8.059-0.389-8.059-0.389
15
- c-1.651-0.096-1.845,2.425-0.194,2.523c0,0,1.561,0.193,3.21,0.29l4.768,13.065l-6.699,20.087L25.46,41.185
16
- c1.844-0.097,3.502-0.29,3.502-0.29c1.648-0.196,1.454-2.619-0.195-2.523c0,0-4.957,0.389-8.157,0.389
17
- c-0.574,0-1.251-0.013-1.971-0.037c5.473-8.309,14.879-13.795,25.573-13.795c7.967,0,15.222,3.047,20.666,8.036
18
- c-0.131-0.008-0.259-0.024-0.395-0.024c-3.007,0-5.141,2.62-5.141,5.432c0,2.523,1.457,4.656,3.007,7.179
19
- c1.163,2.038,2.523,4.656,2.523,8.44c0,2.62-1.008,5.659-2.329,9.895L59.49,74.084L48.431,41.185z M59.6,81.989l9.347-27.027
20
- c1.746-4.366,2.329-7.858,2.329-10.962c0-1.126-0.076-2.172-0.207-3.147c2.389,4.359,3.747,9.362,3.747,14.683
21
- C74.816,66.825,68.698,76.685,59.6,81.989z"/>
22
- <g>
23
- <path fill="#464342" d="M44.055,11.836V1.196L14.095,18.493l29.959,17.296V25.151c16.979,0,30.793,13.812,30.793,30.791
24
- c0,16.28-12.701,29.641-28.713,30.716v13.34c23.36-1.089,42.027-20.431,42.027-44.056C88.162,31.622,68.376,11.836,44.055,11.836z"
25
- />
26
- <path fill="#464342" d="M17.346,91.01c6.901,5.272,15.396,8.559,24.628,8.99V86.659c-5.979-0.403-11.487-2.528-16.05-5.872
27
- L17.346,91.01z"/>
28
- <path fill="#464342" d="M15.897,68.367L3.361,72.931c2.468,5.887,6.178,11.131,10.842,15.33l8.876-10.566
29
- C23.44,78.153,17.183,71.27,15.897,68.367z"/>
30
- <path fill="#464342" d="M14.477,64.456c-0.597-2.065-0.989-4.216-1.137-6.434H0c0.177,3.813,0.85,7.495,1.938,10.997L14.477,64.456
31
- z"/>
32
- </g>
33
- </svg>
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
5
+ width="89.23px" height="100px" viewBox="0 0 89.23 100" enable-background="new 0 0 89.23 100" xml:space="preserve">
6
+ <path fill="#464342" d="M16.196,68.183c-1.398,0.656-1.515,0.518-3.173,1.23c1.898,4.219,4.532,7.676,7.89,10.79
7
+ c0.578-0.766,1.33-1.663,1.987-2.611C20.031,74.901,17.825,71.949,16.196,68.183z"/>
8
+ <path fill="#464342" d="M44.213,21.495c-18.771,0-34.042,15.27-34.042,34.041c0,3.354,0.573,6.886,1.481,9.949
9
+ c0.961-0.427,1.881-0.604,3.26-1.188l-1.306-8.762c-0.054-3.254,0.952-8.649,2.65-12.456l14.6,40
10
+ c-1.733-0.843-3.118-1.677-4.625-2.782c-0.73,1.015-0.974,1.19-2.079,2.646c5.1,3.763,11.132,6.162,17.822,6.579
11
+ c0-0.84,0-2.406,0-3.466c-2.259-0.155-4.31-0.544-6.409-1.161l9.184-26.683l9.406,25.773c0.063,0.151,0.139,0.289,0.22,0.422
12
+ c-2.61,0.918-5.382,1.49-8.26,1.669V86.5c0,1.084,0,1.935,0,3.022c17.887-0.991,32.139-15.855,32.139-33.987
13
+ C78.254,36.765,62.982,21.495,44.213,21.495z M48.431,41.185c1.841-0.097,3.503-0.29,3.503-0.29
14
+ c1.646-0.196,1.454-2.619-0.195-2.523c0,0-4.958,0.389-8.16,0.389c-3.006,0-8.059-0.389-8.059-0.389
15
+ c-1.651-0.096-1.845,2.425-0.194,2.523c0,0,1.561,0.193,3.21,0.29l4.768,13.065l-6.699,20.087L25.46,41.185
16
+ c1.844-0.097,3.502-0.29,3.502-0.29c1.648-0.196,1.454-2.619-0.195-2.523c0,0-4.957,0.389-8.157,0.389
17
+ c-0.574,0-1.251-0.013-1.971-0.037c5.473-8.309,14.879-13.795,25.573-13.795c7.967,0,15.222,3.047,20.666,8.036
18
+ c-0.131-0.008-0.259-0.024-0.395-0.024c-3.007,0-5.141,2.62-5.141,5.432c0,2.523,1.457,4.656,3.007,7.179
19
+ c1.163,2.038,2.523,4.656,2.523,8.44c0,2.62-1.008,5.659-2.329,9.895L59.49,74.084L48.431,41.185z M59.6,81.989l9.347-27.027
20
+ c1.746-4.366,2.329-7.858,2.329-10.962c0-1.126-0.076-2.172-0.207-3.147c2.389,4.359,3.747,9.362,3.747,14.683
21
+ C74.816,66.825,68.698,76.685,59.6,81.989z"/>
22
+ <g>
23
+ <path fill="#464342" d="M44.055,11.836V1.196L14.095,18.493l29.959,17.296V25.151c16.979,0,30.793,13.812,30.793,30.791
24
+ c0,16.28-12.701,29.641-28.713,30.716v13.34c23.36-1.089,42.027-20.431,42.027-44.056C88.162,31.622,68.376,11.836,44.055,11.836z"
25
+ />
26
+ <path fill="#464342" d="M17.346,91.01c6.901,5.272,15.396,8.559,24.628,8.99V86.659c-5.979-0.403-11.487-2.528-16.05-5.872
27
+ L17.346,91.01z"/>
28
+ <path fill="#464342" d="M15.897,68.367L3.361,72.931c2.468,5.887,6.178,11.131,10.842,15.33l8.876-10.566
29
+ C23.44,78.153,17.183,71.27,15.897,68.367z"/>
30
+ <path fill="#464342" d="M14.477,64.456c-0.597-2.065-0.989-4.216-1.137-6.434H0c0.177,3.813,0.85,7.495,1.938,10.997L14.477,64.456
31
+ z"/>
32
+ </g>
33
+ </svg>
assets/js/themes-wp-rollback.js CHANGED
@@ -1,179 +1,178 @@
1
- /**
2
- * Theme Specific WP Rollback
3
- *
4
- * @description: Adds a rollback option to themes
5
- * @copyright: http://opensource.org/licenses/gpl-2.0.php GNU Public License
6
- */
7
- var wpr_vars;
8
- jQuery.noConflict();
9
-
10
- (function ( $ ) {
11
-
12
- /**
13
- * Content Change DOM Event Listenter
14
- *
15
- * @see: http://stackoverflow.com/questions/3233991/jquery-watch-div/3234646#3234646
16
- * @param callback
17
- * @returns {*}
18
- */
19
- jQuery.fn.contentChange = function ( callback ) {
20
- var elms = jQuery( this );
21
- elms.each(
22
- function ( i ) {
23
- var elm = jQuery( this );
24
- elm.data( "lastContents", elm.html() );
25
- window.watchContentChange = window.watchContentChange ? window.watchContentChange : [];
26
- window.watchContentChange.push( {"element": elm, "callback": callback} );
27
- }
28
- );
29
- return elms;
30
- };
31
- setInterval( function () {
32
- if ( window.watchContentChange ) {
33
- for ( i in window.watchContentChange ) {
34
- if ( window.watchContentChange[i].element.data( "lastContents" ) != window.watchContentChange[i].element.html() ) {
35
- window.watchContentChange[i].callback.apply( window.watchContentChange[i].element );
36
- window.watchContentChange[i].element.data( "lastContents", window.watchContentChange[i].element.html() )
37
- }
38
-
39
- }
40
- }
41
- }, 150 );
42
-
43
- //On DOM Ready
44
- $( function () {
45
- var themes;
46
- themes = wp.themes = wp.themes || {};
47
- themes.data = _wpThemeSettings;
48
-
49
- //On clicking a theme template
50
- $( '.theme-overlay' ).contentChange( function ( e ) {
51
-
52
- //get theme name that was clicked
53
- var clicked_theme = wpr_get_parameter_by_name( 'theme' );
54
-
55
- //check that rollback button hasn't been placed
56
- if ( is_rollback_btn_there() ) {
57
- //button is there, bail
58
- return false;
59
- }
60
-
61
- //pass off to rollback function
62
- wpr_theme_rollback( clicked_theme );
63
-
64
-
65
- } );
66
-
67
-
68
- /**
69
- * Check to see if Rollback button is in place
70
- *
71
- * @returns {boolean}
72
- */
73
- function is_rollback_btn_there() {
74
-
75
- if ( $( '.wpr-theme-rollback' ).length > 0 ) {
76
- return true;
77
- }
78
- return false;
79
-
80
-
81
- }
82
-
83
- /**
84
- * Is Theme WordPress.org?
85
- *
86
- * @description Rollback only supports WordPress.org themes
87
- */
88
- function wpr_theme_rollback( theme ) {
89
-
90
- var theme_data = wpr_get_theme_data( theme );
91
-
92
- //ensure this theme can be rolled back (not premium, etc)
93
- if ( theme_data !== null && typeof theme_data.hasRollback !== 'undefined' && theme_data.hasRollback !== false ) {
94
-
95
- var active_theme = $( '.theme-overlay' ).hasClass( 'active' );
96
-
97
-
98
- var rollback_btn_html = '<a href="' + encodeURI( 'index.php?page=wp-rollback&type=theme&theme_file=' + theme + '&current_version=' + theme_data.version + '&rollback_name=' + theme_data.name + '&_wpnonce=' + wpr_vars.nonce ) + '" style="position:absolute;right: ' + (active_theme === true ? '5px' : '80px') + '; bottom: 5px;" class="button wpr-theme-rollback">' + wpr_vars.text_rollback_label + '</a>';
99
-
100
- $( '.theme-wrap' ).find( '.theme-actions' ).append( rollback_btn_html );
101
-
102
- } else {
103
- //Can't roll back this theme, display the
104
- $( '.theme-wrap' ).find( '.theme-actions' ).append( '<span class="no-rollback" style="position: absolute;left: 23px;bottom: 16px;font-size: 12px;font-style: italic;color: rgb(181, 181, 181);">' + wpr_vars.text_not_rollbackable + '</span>' );
105
- }
106
-
107
- }
108
-
109
- /**
110
- * Get Theme Data
111
- *
112
- * @description Loops through the wp.themes.data.themes object, finds a match, and returns the data
113
- * @param theme
114
- * @returns {*}
115
- */
116
- function wpr_get_theme_data( theme ) {
117
- var theme_data = wp.themes.data.themes;
118
-
119
- //Loop through complete theme data to find this current theme's data
120
- for ( var i = 0, len = theme_data.length; i < len; i++ ) {
121
- if ( theme_data[i].id === theme ) {
122
- return theme_data[i]; // Return as soon as the object is found
123
- }
124
- }
125
- return null; // The object was not found
126
- }
127
-
128
- /**
129
- * JS Ready Query String (Helper)
130
- *
131
- * Kinda dirty but whatever...
132
- *
133
- * @see: http://stackoverflow.com/questions/901115/how-can-i-get-query-string-values-in-javascript
134
- * @param name
135
- * @returns {string}
136
- */
137
- function wpr_get_parameter_by_name( name ) {
138
- name = name.replace( /[\[]/, "\\[" ).replace( /[\]]/, "\\]" );
139
- var regex = new RegExp( "[\\?&]" + name + "=([^&#]*)" ),
140
- results = regex.exec( location.search );
141
- return results === null ? "" : decodeURIComponent( results[1].replace( /\+/g, " " ) );
142
- }
143
-
144
- /**
145
- * Get Parameter from Focused Theme
146
- *
147
- * @returns {*}
148
- */
149
- function wpr_get_parameter_from_focused_theme() {
150
- var focused_theme = wp.themes.focusedTheme;
151
- var name = $( focused_theme ).find( '.theme-name' ).attr( 'id' );
152
-
153
- if ( typeof name !== 'undefined' ) {
154
- name = name.replace( '-name', '' );
155
- } else {
156
- return false;
157
- }
158
-
159
- return name;
160
- }
161
-
162
-
163
- /**
164
- * Theme Rollback Button Clicked
165
- *
166
- * @description Send them over to
167
- */
168
- $( 'body' ).on( 'click', '.wpr-theme-rollback', function ( e ) {
169
-
170
- window.location = $( this ).attr( 'href' );
171
-
172
- } );
173
-
174
-
175
-
176
- } );
177
-
178
-
179
- })( jQuery );
1
+ /**
2
+ * Theme Specific WP Rollback
3
+ *
4
+ * @description: Adds a rollback option to themes
5
+ * @copyright: http://opensource.org/licenses/gpl-2.0.php GNU Public License
6
+ */
7
+ var wpr_vars;
8
+ jQuery.noConflict();
9
+
10
+ (function ($) {
11
+
12
+ /**
13
+ * Content Change DOM Event Listenter
14
+ *
15
+ * @see: http://stackoverflow.com/questions/3233991/jquery-watch-div/3234646#3234646
16
+ * @param callback
17
+ * @returns {*}
18
+ */
19
+ jQuery.fn.contentChange = function (callback) {
20
+ var elms = jQuery(this);
21
+ elms.each(
22
+ function (i) {
23
+ var elm = jQuery(this);
24
+ elm.data("lastContents", elm.html());
25
+ window.watchContentChange = window.watchContentChange ? window.watchContentChange : [];
26
+ window.watchContentChange.push({"element": elm, "callback": callback});
27
+ }
28
+ );
29
+ return elms;
30
+ };
31
+ setInterval(function () {
32
+ if (window.watchContentChange) {
33
+ for (i in window.watchContentChange) {
34
+ if (window.watchContentChange[i].element.data("lastContents") != window.watchContentChange[i].element.html()) {
35
+ window.watchContentChange[i].callback.apply(window.watchContentChange[i].element);
36
+ window.watchContentChange[i].element.data("lastContents", window.watchContentChange[i].element.html())
37
+ }
38
+
39
+ }
40
+ }
41
+ }, 150);
42
+
43
+ //On DOM Ready
44
+ $(function () {
45
+ var themes;
46
+ themes = wp.themes = wp.themes || {};
47
+ themes.data = _wpThemeSettings;
48
+
49
+ //On clicking a theme template
50
+ $('.theme-overlay').contentChange(function (e) {
51
+
52
+ //get theme name that was clicked
53
+ var clicked_theme = wpr_get_parameter_by_name('theme');
54
+
55
+ //check that rollback button hasn't been placed
56
+ if (is_rollback_btn_there()) {
57
+ //button is there, bail
58
+ return false;
59
+ }
60
+
61
+ //pass off to rollback function
62
+ wpr_theme_rollback(clicked_theme);
63
+
64
+
65
+ });
66
+
67
+
68
+ /**
69
+ * Check to see if Rollback button is in place
70
+ *
71
+ * @returns {boolean}
72
+ */
73
+ function is_rollback_btn_there() {
74
+
75
+ if ($('.wpr-theme-rollback').length > 0) {
76
+ return true;
77
+ }
78
+ return false;
79
+
80
+
81
+ }
82
+
83
+ /**
84
+ * Is Theme WordPress.org?
85
+ *
86
+ * @description Rollback only supports WordPress.org themes
87
+ */
88
+ function wpr_theme_rollback(theme) {
89
+
90
+ var theme_data = wpr_get_theme_data(theme);
91
+
92
+ //ensure this theme can be rolled back (not premium, etc)
93
+ if (theme_data !== null && typeof theme_data.hasRollback !== 'undefined' && theme_data.hasRollback !== false) {
94
+
95
+ var active_theme = $('.theme-overlay').hasClass('active');
96
+
97
+
98
+ var rollback_btn_html = '<a href="' + encodeURI('index.php?page=wp-rollback&type=theme&theme_file=' + theme + '&current_version=' + theme_data.version + '&rollback_name=' + theme_data.name + '&_wpnonce=' + wpr_vars.nonce) + '" style="position:absolute;right: ' + (active_theme === true ? '5px' : '80px') + '; bottom: 5px;" class="button wpr-theme-rollback">' + wpr_vars.text_rollback_label + '</a>';
99
+
100
+ $('.theme-wrap').find('.theme-actions').append(rollback_btn_html);
101
+
102
+ } else {
103
+ //Can't roll back this theme, display the notice.
104
+ $('.theme-wrap').find('.theme-actions').append('<span class="no-rollback" style="position: absolute;left: 23px;bottom: 16px;font-size: 12px;font-style: italic;color: rgb(181, 181, 181);">' + wpr_vars.text_not_rollbackable + '</span>');
105
+ }
106
+
107
+ }
108
+
109
+ /**
110
+ * Get Theme Data
111
+ *
112
+ * @description Loops through the wp.themes.data.themes object, finds a match, and returns the data
113
+ * @param theme
114
+ * @returns {*}
115
+ */
116
+ function wpr_get_theme_data(theme) {
117
+ var theme_data = wp.themes.data.themes;
118
+
119
+ //Loop through complete theme data to find this current theme's data
120
+ for (var i = 0, len = theme_data.length; i < len; i++) {
121
+ if (theme_data[i].id === theme) {
122
+ return theme_data[i]; // Return as soon as the object is found
123
+ }
124
+ }
125
+ return null; // The object was not found
126
+ }
127
+
128
+ /**
129
+ * JS Ready Query String (Helper)
130
+ *
131
+ * Kinda dirty but whatever...
132
+ *
133
+ * @see: http://stackoverflow.com/questions/901115/how-can-i-get-query-string-values-in-javascript
134
+ * @param name
135
+ * @returns {string}
136
+ */
137
+ function wpr_get_parameter_by_name(name) {
138
+ name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
139
+ var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
140
+ results = regex.exec(location.search);
141
+ return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
142
+ }
143
+
144
+ /**
145
+ * Get Parameter from Focused Theme
146
+ *
147
+ * @returns {*}
148
+ */
149
+ function wpr_get_parameter_from_focused_theme() {
150
+ var focused_theme = wp.themes.focusedTheme;
151
+ var name = $(focused_theme).find('.theme-name').attr('id');
152
+
153
+ if (typeof name !== 'undefined') {
154
+ name = name.replace('-name', '');
155
+ } else {
156
+ return false;
157
+ }
158
+
159
+ return name;
160
+ }
161
+
162
+
163
+ /**
164
+ * Theme Rollback Button Clicked
165
+ *
166
+ * @description Send them over to
167
+ */
168
+ $('body').on('click', '.wpr-theme-rollback', function (e) {
169
+
170
+ window.location = $(this).attr('href');
171
+
172
+ });
173
+
174
+
175
+ });
176
+
177
+
178
+ })(jQuery);
 
assets/js/wp-rollback.js CHANGED
@@ -1,91 +1,91 @@
1
- /**
2
- * WP Rollback Scripts
3
- *
4
- * @description:
5
- * @copyright: http://opensource.org/licenses/gpl-2.0.php GNU Public License
6
- */
7
-
8
- var wpr_vars;
9
-
10
- jQuery.noConflict();
11
- (function ( $ ) {
12
-
13
- //On DOM Ready
14
- $( function () {
15
-
16
- var form = $( '.rollback-form' );
17
- var form_labels = $( 'label', form.get( 0 ) );
18
- var form_submit_btn = $( '.magnific-popup' );
19
-
20
- //On Element Click
21
- form_labels.on( 'click', function () {
22
-
23
- //add a selected class
24
- form_labels.removeClass( 'wpr-selected' );
25
- form_submit_btn.removeClass( 'wpr-rollback-disabled' );
26
- $( this ).addClass( 'wpr-selected' );
27
-
28
- //ensure the radio button always gets clicked
29
- $( this ).find( 'input' ).prop( 'checked', true );
30
-
31
- } );
32
-
33
- //Modal
34
- form_submit_btn.on( 'click', function () {
35
-
36
- var rollback_form_vals = form.serializeArray();
37
-
38
- var rollback_version = form.find( 'input[name="plugin_version"]:checked' ).val();
39
- if ( !rollback_version ) {
40
- rollback_version = form.find( 'input[name="theme_version"]:checked' ).val();
41
- }
42
- var installed_version = form.find( 'input[name="installed_version"]' ).val();
43
- var new_version = form.find( 'input[name="new_version"]' ).val();
44
- var rollback_name = form.find( 'input[name="rollback_name"]' ).val();
45
-
46
- //Ensure a version is selected
47
- if ( !rollback_version ) {
48
-
49
- alert( wpr_vars.version_missing );
50
- $.magnificPopup.close(); //just for good measure
51
-
52
- } else {
53
-
54
- //Passed
55
- $.magnificPopup.open( {
56
- items : {
57
- src : $( '#wpr-modal-confirm' ), // can be a HTML string, jQuery object, or CSS selector
58
- type: 'inline'
59
- },
60
- closeBtnInside: false,
61
- callbacks : {
62
- open: function () {
63
-
64
- $( 'span.wpr-plugin-name' ).text( rollback_name );
65
- $( 'span.wpr-installed-version' ).text( installed_version );
66
- $( 'span.wpr-new-version' ).text( rollback_version );
67
-
68
- }
69
- }
70
- } );
71
-
72
-
73
- }
74
-
75
- } );
76
-
77
- //Modal Close
78
- $( '.wpr-close' ).on( 'click', function ( e ) {
79
- e.preventDefault();
80
- $.magnificPopup.close();
81
- } );
82
- //Modal Confirm (GO! GO! GO!)
83
- $( '.wpr-go' ).on( 'click', function ( e ) {
84
- //submit form
85
- form.submit();
86
- } );
87
-
88
- } );
89
-
90
-
91
  })( jQuery );
1
+ /**
2
+ * WP Rollback Scripts
3
+ *
4
+ * @description:
5
+ * @copyright: http://opensource.org/licenses/gpl-2.0.php GNU Public License
6
+ */
7
+
8
+ var wpr_vars;
9
+
10
+ jQuery.noConflict();
11
+ (function ( $ ) {
12
+
13
+ //On DOM Ready
14
+ $( function () {
15
+
16
+ var form = $( '.rollback-form' );
17
+ var form_labels = $( 'label', form.get( 0 ) );
18
+ var form_submit_btn = $( '.magnific-popup' );
19
+
20
+ //On Element Click
21
+ form_labels.on( 'click', function () {
22
+
23
+ //add a selected class
24
+ form_labels.removeClass( 'wpr-selected' );
25
+ form_submit_btn.removeClass( 'wpr-rollback-disabled' );
26
+ $( this ).addClass( 'wpr-selected' );
27
+
28
+ //ensure the radio button always gets clicked
29
+ $( this ).find( 'input' ).prop( 'checked', true );
30
+
31
+ } );
32
+
33
+ //Modal
34
+ form_submit_btn.on( 'click', function () {
35
+
36
+ var rollback_form_vals = form.serializeArray();
37
+
38
+ var rollback_version = form.find( 'input[name="plugin_version"]:checked' ).val();
39
+ if ( !rollback_version ) {
40
+ rollback_version = form.find( 'input[name="theme_version"]:checked' ).val();
41
+ }
42
+ var installed_version = form.find( 'input[name="installed_version"]' ).val();
43
+ var new_version = form.find( 'input[name="new_version"]' ).val();
44
+ var rollback_name = form.find( 'input[name="rollback_name"]' ).val();
45
+
46
+ //Ensure a version is selected
47
+ if ( !rollback_version ) {
48
+
49
+ alert( wpr_vars.version_missing );
50
+ $.magnificPopup.close(); //just for good measure
51
+
52
+ } else {
53
+
54
+ //Passed
55
+ $.magnificPopup.open( {
56
+ items : {
57
+ src : $( '#wpr-modal-confirm' ), // can be a HTML string, jQuery object, or CSS selector
58
+ type: 'inline'
59
+ },
60
+ closeBtnInside: false,
61
+ callbacks : {
62
+ open: function () {
63
+
64
+ $( 'span.wpr-plugin-name' ).text( rollback_name );
65
+ $( 'span.wpr-installed-version' ).text( installed_version );
66
+ $( 'span.wpr-new-version' ).text( rollback_version );
67
+
68
+ }
69
+ }
70
+ } );
71
+
72
+
73
+ }
74
+
75
+ } );
76
+
77
+ //Modal Close
78
+ $( '.wpr-close' ).on( 'click', function ( e ) {
79
+ e.preventDefault();
80
+ $.magnificPopup.close();
81
+ } );
82
+ //Modal Confirm (GO! GO! GO!)
83
+ $( '.wpr-go' ).on( 'click', function ( e ) {
84
+ //submit form
85
+ form.submit();
86
+ } );
87
+
88
+ } );
89
+
90
+
91
  })( jQuery );
includes/class-rollback-plugin-upgrader.php CHANGED
@@ -1,75 +1,75 @@
1
- <?php
2
- /**
3
- * WP Rollback Plugin Upgrader
4
- *
5
- * @description: Class that extends the WP Core Plugin_Upgrader found in core to do rollbacks
6
- * @copyright : http://opensource.org/licenses/gpl-2.0.php GNU Public License
7
- * @since : 1.0.0
8
- */
9
-
10
- // Exit if accessed directly
11
- if ( ! defined( 'ABSPATH' ) ) {
12
- exit;
13
- }
14
-
15
- //kick things off
16
- class WP_Rollback_Plugin_Upgrader extends Plugin_Upgrader {
17
-
18
- public function rollback( $plugin, $args = array() ) {
19
-
20
- $defaults = array(
21
- 'clear_update_cache' => true,
22
- );
23
- $parsed_args = wp_parse_args( $args, $defaults );
24
-
25
- $this->init();
26
- $this->upgrade_strings();
27
-
28
- // TODO: Add final check to make sure plugin exists
29
- if ( 0 ) {
30
- $this->skin->before();
31
- $this->skin->set_result( false );
32
- $this->skin->error( 'up_to_date' );
33
- $this->skin->after();
34
-
35
- return false;
36
- }
37
-
38
- $plugin_slug = $this->skin->plugin;
39
-
40
- $plugin_version = $this->skin->options['version'];
41
-
42
- $download_endpoint = 'https://downloads.wordpress.org/plugin/';
43
-
44
- $url = $download_endpoint . $plugin_slug . '.' . $plugin_version . '.zip';
45
-
46
- add_filter( 'upgrader_pre_install', array( $this, 'deactivate_plugin_before_upgrade' ), 10, 2 );
47
- add_filter( 'upgrader_clear_destination', array( $this, 'delete_old_plugin' ), 10, 4 );
48
-
49
- $this->run( array(
50
- 'package' => $url,
51
- 'destination' => WP_PLUGIN_DIR,
52
- 'clear_destination' => true,
53
- 'clear_working' => true,
54
- 'hook_extra' => array(
55
- 'plugin' => $plugin,
56
- 'type' => 'plugin',
57
- 'action' => 'update',
58
- ),
59
- ) );
60
-
61
- // Cleanup our hooks, in case something else does a upgrade on this connection.
62
- remove_filter( 'upgrader_pre_install', array( $this, 'deactivate_plugin_before_upgrade' ) );
63
- remove_filter( 'upgrader_clear_destination', array( $this, 'delete_old_plugin' ) );
64
-
65
- if ( ! $this->result || is_wp_error( $this->result ) ) {
66
- return $this->result;
67
- }
68
-
69
- // Force refresh of plugin update information
70
- wp_clean_plugins_cache( $parsed_args['clear_update_cache'] );
71
-
72
- return true;
73
- }
74
-
75
  }
1
+ <?php
2
+ /**
3
+ * WP Rollback Plugin Upgrader
4
+ *
5
+ * @description: Class that extends the WP Core Plugin_Upgrader found in core to do rollbacks
6
+ * @copyright : http://opensource.org/licenses/gpl-2.0.php GNU Public License
7
+ * @since : 1.0.0
8
+ */
9
+
10
+ // Exit if accessed directly
11
+ if ( ! defined( 'ABSPATH' ) ) {
12
+ exit;
13
+ }
14
+
15
+ //kick things off
16
+ class WP_Rollback_Plugin_Upgrader extends Plugin_Upgrader {
17
+
18
+ public function rollback( $plugin, $args = array() ) {
19
+
20
+ $defaults = array(
21
+ 'clear_update_cache' => true,
22
+ );
23
+ $parsed_args = wp_parse_args( $args, $defaults );
24
+
25
+ $this->init();
26
+ $this->upgrade_strings();
27
+
28
+ // TODO: Add final check to make sure plugin exists
29
+ if ( 0 ) {
30
+ $this->skin->before();
31
+ $this->skin->set_result( false );
32
+ $this->skin->error( 'up_to_date' );
33
+ $this->skin->after();
34
+
35
+ return false;
36
+ }
37
+
38
+ $plugin_slug = $this->skin->plugin;
39
+
40
+ $plugin_version = $this->skin->options['version'];
41
+
42
+ $download_endpoint = 'https://downloads.wordpress.org/plugin/';
43
+
44
+ $url = $download_endpoint . $plugin_slug . '.' . $plugin_version . '.zip';
45
+
46
+ add_filter( 'upgrader_pre_install', array( $this, 'deactivate_plugin_before_upgrade' ), 10, 2 );
47
+ add_filter( 'upgrader_clear_destination', array( $this, 'delete_old_plugin' ), 10, 4 );
48
+
49
+ $this->run( array(
50
+ 'package' => $url,
51
+ 'destination' => WP_PLUGIN_DIR,
52
+ 'clear_destination' => true,
53
+ 'clear_working' => true,
54
+ 'hook_extra' => array(
55
+ 'plugin' => $plugin,
56
+ 'type' => 'plugin',
57
+ 'action' => 'update',
58
+ ),
59
+ ) );
60
+
61
+ // Cleanup our hooks, in case something else does a upgrade on this connection.
62
+ remove_filter( 'upgrader_pre_install', array( $this, 'deactivate_plugin_before_upgrade' ) );
63
+ remove_filter( 'upgrader_clear_destination', array( $this, 'delete_old_plugin' ) );
64
+
65
+ if ( ! $this->result || is_wp_error( $this->result ) ) {
66
+ return $this->result;
67
+ }
68
+
69
+ // Force refresh of plugin update information
70
+ wp_clean_plugins_cache( $parsed_args['clear_update_cache'] );
71
+
72
+ return true;
73
+ }
74
+
75
  }
includes/class-rollback-theme-upgrader.php CHANGED
@@ -1,80 +1,80 @@
1
- <?php
2
- /**
3
- * WP Rollback Theme Upgrader
4
- *
5
- * @description: Class that extends the WP Core Theme_Upgrader found in core to do rollbacks
6
- * @copyright : http://opensource.org/licenses/gpl-2.0.php GNU Public License
7
- * @since : 1.0.0
8
- */
9
-
10
- // Exit if accessed directly
11
- if ( ! defined( 'ABSPATH' ) ) {
12
- exit;
13
- }
14
-
15
- //kick things off
16
- class WP_Rollback_Theme_Upgrader extends Theme_Upgrader {
17
-
18
- public function rollback( $theme, $args = array() ) {
19
-
20
- $defaults = array(
21
- 'clear_update_cache' => true,
22
- );
23
- $parsed_args = wp_parse_args( $args, $defaults );
24
-
25
- $this->init();
26
- $this->upgrade_strings();
27
-
28
- if ( 0 ) {
29
- $this->skin->before();
30
- $this->skin->set_result( false );
31
- $this->skin->error( 'up_to_date' );
32
- $this->skin->after();
33
-
34
- return false;
35
- }
36
-
37
- $theme_slug = $this->skin->theme;
38
-
39
- $theme_version = $this->skin->options['version'];
40
-
41
- $download_endpoint = 'https://downloads.wordpress.org/theme/';
42
-
43
- $url = $download_endpoint . $theme_slug . '.' . $theme_version . '.zip';
44
-
45
-
46
- add_filter( 'upgrader_pre_install', array( $this, 'current_before' ), 10, 2 );
47
- add_filter( 'upgrader_post_install', array( $this, 'current_after' ), 10, 2 );
48
- add_filter( 'upgrader_clear_destination', array( $this, 'delete_old_theme' ), 10, 4 );
49
-
50
- //'source_selection' => array($this, 'source_selection'), //there's a trac ticket to move up the directory for zip's which are made a bit differently, useful for non-.org plugins.
51
-
52
- $this->run( array(
53
- 'package' => $url,
54
- 'destination' => get_theme_root(),
55
- 'clear_destination' => true,
56
- 'clear_working' => true,
57
- 'hook_extra' => array(
58
- 'theme' => $theme,
59
- 'type' => 'theme',
60
- 'action' => 'update',
61
- ),
62
- ) );
63
-
64
-
65
- remove_filter( 'upgrader_pre_install', array( $this, 'current_before' ) );
66
- remove_filter( 'upgrader_post_install', array( $this, 'current_after' ) );
67
- remove_filter( 'upgrader_clear_destination', array( $this, 'delete_old_theme' ) );
68
-
69
- if ( ! $this->result || is_wp_error( $this->result ) ) {
70
- return $this->result;
71
- }
72
-
73
- // Force refresh of theme update information
74
- wp_clean_themes_cache( $parsed_args['clear_update_cache'] );
75
-
76
- return true;
77
-
78
- }
79
-
80
  }
1
+ <?php
2
+ /**
3
+ * WP Rollback Theme Upgrader
4
+ *
5
+ * @description: Class that extends the WP Core Theme_Upgrader found in core to do rollbacks
6
+ * @copyright : http://opensource.org/licenses/gpl-2.0.php GNU Public License
7
+ * @since : 1.0.0
8
+ */
9
+
10
+ // Exit if accessed directly
11
+ if ( ! defined( 'ABSPATH' ) ) {
12
+ exit;
13
+ }
14
+
15
+ //kick things off
16
+ class WP_Rollback_Theme_Upgrader extends Theme_Upgrader {
17
+
18
+ public function rollback( $theme, $args = array() ) {
19
+
20
+ $defaults = array(
21
+ 'clear_update_cache' => true,
22
+ );
23
+ $parsed_args = wp_parse_args( $args, $defaults );
24
+
25
+ $this->init();
26
+ $this->upgrade_strings();
27
+
28
+ if ( 0 ) {
29
+ $this->skin->before();
30
+ $this->skin->set_result( false );
31
+ $this->skin->error( 'up_to_date' );
32
+ $this->skin->after();
33
+
34
+ return false;
35
+ }
36
+
37
+ $theme_slug = $this->skin->theme;
38
+
39
+ $theme_version = $this->skin->options['version'];
40
+
41
+ $download_endpoint = 'https://downloads.wordpress.org/theme/';
42
+
43
+ $url = $download_endpoint . $theme_slug . '.' . $theme_version . '.zip';
44
+
45
+
46
+ add_filter( 'upgrader_pre_install', array( $this, 'current_before' ), 10, 2 );
47
+ add_filter( 'upgrader_post_install', array( $this, 'current_after' ), 10, 2 );
48
+ add_filter( 'upgrader_clear_destination', array( $this, 'delete_old_theme' ), 10, 4 );
49
+
50
+ //'source_selection' => array($this, 'source_selection'), //there's a trac ticket to move up the directory for zip's which are made a bit differently, useful for non-.org plugins.
51
+
52
+ $this->run( array(
53
+ 'package' => $url,
54
+ 'destination' => get_theme_root(),
55
+ 'clear_destination' => true,
56
+ 'clear_working' => true,
57
+ 'hook_extra' => array(
58
+ 'theme' => $theme,
59
+ 'type' => 'theme',
60
+ 'action' => 'update',
61
+ ),
62
+ ) );
63
+
64
+
65
+ remove_filter( 'upgrader_pre_install', array( $this, 'current_before' ) );
66
+ remove_filter( 'upgrader_post_install', array( $this, 'current_after' ) );
67
+ remove_filter( 'upgrader_clear_destination', array( $this, 'delete_old_theme' ) );
68
+
69
+ if ( ! $this->result || is_wp_error( $this->result ) ) {
70
+ return $this->result;
71
+ }
72
+
73
+ // Force refresh of theme update information
74
+ wp_clean_themes_cache( $parsed_args['clear_update_cache'] );
75
+
76
+ return true;
77
+
78
+ }
79
+
80
  }
includes/rollback-action.php CHANGED
@@ -1,37 +1,37 @@
1
- <?php
2
- /**
3
- * Rollback Action
4
- */
5
-
6
- // Exit if accessed directly
7
- if ( ! defined( 'ABSPATH' ) ) {
8
- exit;
9
- }
10
-
11
- $nonce = 'upgrade-plugin_' . $this->plugin_slug;
12
- $url = 'index.php?page=wp-rollback&plugin_file=' . esc_url( $args['plugin_file'] ) . 'action=upgrade-plugin';
13
- $plugin = $this->plugin_slug;
14
- $version = $args['plugin_version'];
15
-
16
- //Theme rollback
17
- if ( ! empty( $_GET['theme_file'] ) && file_exists( WP_CONTENT_DIR . '/themes/' . $_GET['theme_file'] ) ) {
18
-
19
- //theme specific vars
20
- $nonce = 'upgrade-theme_' . $_GET['theme_file'];
21
- $url = 'index.php?page=wp-rollback&theme_file=' . $args['theme_file'] . 'action=upgrade-theme';
22
- $version = $_GET['theme_version'];
23
- $theme = $_GET['theme_file'];
24
-
25
- $upgrader = new WP_Rollback_Theme_Upgrader( new Theme_Upgrader_Skin( compact( 'title', 'nonce', 'url', 'theme', 'version' ) ) );
26
-
27
- $upgrader->rollback( $_GET['theme_file'] );
28
-
29
- } elseif ( ! empty( $_GET['plugin_file'] ) && file_exists( WP_PLUGIN_DIR . '/' . $_GET['plugin_file'] ) ) {
30
- //This is a plugin rollback
31
- $upgrader = new WP_Rollback_Plugin_Upgrader( new Plugin_Upgrader_Skin( compact( 'title', 'nonce', 'url', 'plugin', 'version' ) ) );
32
-
33
- $upgrader->rollback( $this->plugin_file );
34
- } else {
35
- _e( 'This rollback request is missing proper query string. Please contact support.', 'wpr' );
36
- }
37
-
1
+ <?php
2
+ /**
3
+ * Rollback Action.
4
+ */
5
+
6
+ // Exit if accessed directly
7
+ if ( ! defined( 'ABSPATH' ) ) {
8
+ exit;
9
+ }
10
+
11
+ $nonce = 'upgrade-plugin_' . $this->plugin_slug;
12
+ $url = 'index.php?page=wp-rollback&plugin_file=' . esc_url( $args['plugin_file'] ) . 'action=upgrade-plugin';
13
+ $plugin = $this->plugin_slug;
14
+ $version = $args['plugin_version'];
15
+
16
+ //Theme rollback
17
+ if ( ! empty( $_GET['theme_file'] ) && file_exists( WP_CONTENT_DIR . '/themes/' . $_GET['theme_file'] ) ) {
18
+
19
+ //theme specific vars
20
+ $nonce = 'upgrade-theme_' . $_GET['theme_file'];
21
+ $url = 'index.php?page=wp-rollback&theme_file=' . $args['theme_file'] . 'action=upgrade-theme';
22
+ $version = $_GET['theme_version'];
23
+ $theme = $_GET['theme_file'];
24
+
25
+ $upgrader = new WP_Rollback_Theme_Upgrader( new Theme_Upgrader_Skin( compact( 'title', 'nonce', 'url', 'theme', 'version' ) ) );
26
+
27
+ $upgrader->rollback( $_GET['theme_file'] );
28
+
29
+ } elseif ( ! empty( $_GET['plugin_file'] ) && file_exists( WP_PLUGIN_DIR . '/' . $_GET['plugin_file'] ) ) {
30
+ //This is a plugin rollback
31
+ $upgrader = new WP_Rollback_Plugin_Upgrader( new Plugin_Upgrader_Skin( compact( 'title', 'nonce', 'url', 'plugin', 'version' ) ) );
32
+
33
+ $upgrader->rollback( $this->plugin_file );
34
+ } else {
35
+ _e( 'This rollback request is a missing proper query string. Please contact support.', 'wp-rollback' );
36
+ }
37
+
includes/rollback-menu.php CHANGED
@@ -1,131 +1,131 @@
1
- <?php
2
- /**
3
- * Rollback Menu
4
- *
5
- * @description Provides the rollback screen view with releases and
6
- *
7
- */
8
-
9
-
10
- //Ensure we have our necessary query strings
11
- if ( ( ! isset( $_GET['type'] ) && ! isset( $_GET['theme'] ) ) || ( ! isset( $_GET['type'] ) && ! isset( $_GET['plugin_file'] ) ) ) {
12
- wp_die( __( 'WP Rollback is missing necessary parameters to continue. Please contact support.', 'wpr' ) );
13
- }
14
-
15
- $theme_rollback = $_GET['type'] == 'theme' ? true : false;
16
- $plugin_rollback = $_GET['type'] == 'plugin' ? true : false;
17
- $plugins = get_plugins();
18
- ?>
19
- <div class="wrap">
20
-
21
- <div class="wpr-content-wrap">
22
-
23
- <h1>
24
- <img src="<?php echo WP_ROLLBACK_PLUGIN_URL; ?>/assets/images/wprb-icon-final.svg" onerror="this.onerror=null; this.src='<?php echo WP_ROLLBACK_PLUGIN_URL; ?>/assets/images/wprb-logo.png'"><?php _e( 'WP Rollback', 'wpr' ); ?>
25
- </h1>
26
-
27
- <p><?php echo apply_filters( 'wpr_rollback_description', sprintf( __( 'Please select which %1$s version you would like to rollback to from the releases listed below. You currently have version %2$s installed of %3$s.', 'wpr' ), '<span class="type">' . ( $theme_rollback == true ? __( 'theme', 'wpr' ) : __( 'plugin', 'wpr' ) ) . '</span>', '<span class="current-version">' . esc_html( $args['current_version'] ) . '</span>', '<span class="rollback-name">' . esc_html( $args['rollback_name'] ) . '</span>' ) ); ?></p>
28
-
29
- </div>
30
-
31
- <?php if ( isset( $args['plugin_file'] ) && in_array( $args['plugin_file'], array_keys( $plugins ) ) ) {
32
- $versions = WP_Rollback()->versions_select( 'plugin' );
33
- } elseif ( $theme_rollback == true && isset( $_GET['theme_file'] ) ) {
34
- //theme rollback: set up our theme vars
35
- $svn_tags = WP_Rollback()->get_svn_tags( 'theme', $_GET['theme_file'] );
36
- $this->set_svn_versions_data( $svn_tags );
37
- $this->current_version = $_GET['current_version'];
38
- $versions = WP_Rollback()->versions_select( 'theme' );
39
-
40
- } else {
41
- //Fallback check
42
- wp_die( 'Oh no! We\'re missing required rollback query strings. Please contact support so we can check this bug out and squash it!', 'wpr' );
43
- }
44
- ?>
45
-
46
- <form name="check_for_rollbacks" class="rollback-form" action="<?php echo admin_url( '/index.php' ); ?>">
47
- <?php
48
- //Output Versions
49
- if ( ! empty( $versions ) ) { ?>
50
-
51
- <div class="wpr-versions-wrap">
52
-
53
- <?php
54
- do_action( 'wpr_pre_versions' );
55
-
56
- echo apply_filters( 'wpr_versions_output', $versions );
57
-
58
- do_action( 'wpr_post_version' ); ?>
59
-
60
- </div>
61
-
62
- <?php } ?>
63
-
64
- <div class="wpr-submit-wrap">
65
- <a href="#wpr-modal-confirm" class="magnific-popup button-primary wpr-rollback-disabled"><?php _e( 'Rollback', 'wpr' ); ?></a>
66
- <input type="button" value="<?php _e( 'Cancel', 'wpr' ); ?>" class="button" onclick="location.href='<?php echo wp_get_referer(); ?>';" />
67
- </div>
68
- <?php do_action( 'wpr_hidden_fields' ); ?>
69
- <input type="hidden" name="page" value="wp-rollback">
70
- <?php
71
- //Important: We need the appropriate file to perform a rollback
72
- if ( $plugin_rollback == true ) { ?>
73
- <input type="hidden" name="plugin_file" value="<?php echo esc_attr( $args['plugin_file'] ); ?>">
74
- <?php } else { ?>
75
- <input type="hidden" name="theme_file" value="<?php echo esc_attr( $_GET['theme_file'] ); ?>">
76
- <?php } ?>
77
- <input type="hidden" name="rollback_name" value="<?php echo esc_attr( $args['rollback_name'] ); ?>">
78
- <input type="hidden" name="installed_version" value="<?php echo esc_attr( $args['current_version'] ); ?>">
79
- <?php wp_nonce_field( 'wpr_rollback_nonce' ); ?>
80
-
81
- <div id="wpr-modal-confirm" class="white-popup mfp-hide">
82
- <div class="wpr-modal-inner">
83
- <p class="wpr-rollback-intro"><?php
84
- _e( 'Are you sure you want to perform the following rollback?', 'wpr' );
85
- ?></p>
86
-
87
- <div class="rollback-details">
88
- <table class="widefat">
89
- <tbody>
90
- <?php do_action( 'wpr_pre_rollback_table' ); ?>
91
- <tr>
92
- <td class="row-title">
93
- <label for="tablecell"><?php if ( $plugin_rollback == true ) {
94
- _e( 'Plugin Name:', 'wpr' );
95
- } else {
96
- _e( 'Theme Name:', 'wpr' );
97
- } ?></label>
98
- </td>
99
- <td><span class="wpr-plugin-name"></span></td>
100
- </tr>
101
- <tr class="alternate">
102
- <td class="row-title">
103
- <label for="tablecell"><?php _e( 'Installed Version:', 'wpr' ); ?></label>
104
- </td>
105
- <td><span class="wpr-installed-version"></span></td>
106
- </tr>
107
- <tr>
108
- <td class="row-title">
109
- <label for="tablecell"><?php _e( 'New Version:', 'wpr' ); ?></label>
110
- </td>
111
- <td><span class="wpr-new-version"></span></td>
112
- </tr>
113
- <?php do_action( 'wpr_post_rollback_table' ); ?>
114
- </tbody>
115
- </table>
116
- </div>
117
- <div class="wpr-error">
118
- <p><?php
119
- _e( '<strong>Notice:</strong> We strongly recommend you perform a test rollback on a staging site and create a complete backup of your WordPress files and database prior to performing a rollback. We are not responsible for any misuse, deletions, white screens, fatal errors, or any other issue arising from using this plugin.', 'wpr' );
120
- ?></p>
121
- </div>
122
- <?php do_action( 'wpr_pre_rollback_buttons' ); ?>
123
- <input type="submit" value="<?php _e( 'Rollback', 'wpr' ); ?>" class="button-primary wpr-go" />
124
- <a href="#" class="button wpr-close"><?php _e( 'Cancel', 'wpr' ); ?></a>
125
- <?php do_action( 'wpr_post_rollback_buttons' ); ?>
126
- </div>
127
- </div>
128
-
129
- </form>
130
-
131
  </div>
1
+ <?php
2
+ /**
3
+ * Rollback Menu
4
+ *
5
+ * @description Provides the rollback screen view with releases and
6
+ *
7
+ */
8
+
9
+
10
+ //Ensure we have our necessary query strings
11
+ if ( ( ! isset( $_GET['type'] ) && ! isset( $_GET['theme'] ) ) || ( ! isset( $_GET['type'] ) && ! isset( $_GET['plugin_file'] ) ) ) {
12
+ wp_die( __( 'WP Rollback is missing necessary parameters to continue. Please contact support.', 'wp-rollback' ) );
13
+ }
14
+
15
+ $theme_rollback = $_GET['type'] == 'theme' ? true : false;
16
+ $plugin_rollback = $_GET['type'] == 'plugin' ? true : false;
17
+ $plugins = get_plugins();
18
+ ?>
19
+ <div class="wrap">
20
+
21
+ <div class="wpr-content-wrap">
22
+
23
+ <h1>
24
+ <img src="<?php echo WP_ROLLBACK_PLUGIN_URL; ?>/assets/images/wprb-icon-final.svg" onerror="this.onerror=null; this.src='<?php echo WP_ROLLBACK_PLUGIN_URL; ?>/assets/images/wprb-logo.png'"><?php _e( 'WP Rollback', 'wp-rollback' ); ?>
25
+ </h1>
26
+
27
+ <p><?php echo apply_filters( 'wpr_rollback_description', sprintf( __( 'Please select which %1$s version you would like to rollback to from the releases listed below. You currently have version %2$s installed of %3$s.', 'wp-rollback' ), '<span class="type">' . ( $theme_rollback == true ? __( 'theme', 'wp-rollback' ) : __( 'plugin', 'wp-rollback' ) ) . '</span>', '<span class="current-version">' . esc_html( $args['current_version'] ) . '</span>', '<span class="rollback-name">' . esc_html( $args['rollback_name'] ) . '</span>' ) ); ?></p>
28
+
29
+ </div>
30
+
31
+ <?php if ( isset( $args['plugin_file'] ) && in_array( $args['plugin_file'], array_keys( $plugins ) ) ) {
32
+ $versions = WP_Rollback()->versions_select( 'plugin' );
33
+ } elseif ( $theme_rollback == true && isset( $_GET['theme_file'] ) ) {
34
+ //theme rollback: set up our theme vars
35
+ $svn_tags = WP_Rollback()->get_svn_tags( 'theme', $_GET['theme_file'] );
36
+ $this->set_svn_versions_data( $svn_tags );
37
+ $this->current_version = $_GET['current_version'];
38
+ $versions = WP_Rollback()->versions_select( 'theme' );
39
+
40
+ } else {
41
+ //Fallback check
42
+ wp_die( 'Oh no! We\'re missing required rollback query strings. Please contact support so we can check this bug out and squash it!', 'wp-rollback' );
43
+ }
44
+ ?>
45
+
46
+ <form name="check_for_rollbacks" class="rollback-form" action="<?php echo admin_url( '/index.php' ); ?>">
47
+ <?php
48
+ //Output Versions
49
+ if ( ! empty( $versions ) ) { ?>
50
+
51
+ <div class="wpr-versions-wrap">
52
+
53
+ <?php
54
+ do_action( 'wpr_pre_versions' );
55
+
56
+ echo apply_filters( 'wpr_versions_output', $versions );
57
+
58
+ do_action( 'wpr_post_version' ); ?>
59
+
60
+ </div>
61
+
62
+ <?php } ?>
63
+
64
+ <div class="wpr-submit-wrap">
65
+ <a href="#wpr-modal-confirm" class="magnific-popup button-primary wpr-rollback-disabled"><?php _e( 'Rollback', 'wp-rollback' ); ?></a>
66
+ <input type="button" value="<?php _e( 'Cancel', 'wp-rollback' ); ?>" class="button" onclick="location.href='<?php echo wp_get_referer(); ?>';" />
67
+ </div>
68
+ <?php do_action( 'wpr_hidden_fields' ); ?>
69
+ <input type="hidden" name="page" value="wp-rollback">
70
+ <?php
71
+ //Important: We need the appropriate file to perform a rollback
72
+ if ( $plugin_rollback == true ) { ?>
73
+ <input type="hidden" name="plugin_file" value="<?php echo esc_attr( $args['plugin_file'] ); ?>">
74
+ <?php } else { ?>
75
+ <input type="hidden" name="theme_file" value="<?php echo esc_attr( $_GET['theme_file'] ); ?>">
76
+ <?php } ?>
77
+ <input type="hidden" name="rollback_name" value="<?php echo esc_attr( $args['rollback_name'] ); ?>">
78
+ <input type="hidden" name="installed_version" value="<?php echo esc_attr( $args['current_version'] ); ?>">
79
+ <?php wp_nonce_field( 'wpr_rollback_nonce' ); ?>
80
+
81
+ <div id="wpr-modal-confirm" class="white-popup mfp-hide">
82
+ <div class="wpr-modal-inner">
83
+ <p class="wpr-rollback-intro"><?php
84
+ _e( 'Are you sure you want to perform the following rollback?', 'wp-rollback' );
85
+ ?></p>
86
+
87
+ <div class="rollback-details">
88
+ <table class="widefat">
89
+ <tbody>
90
+ <?php do_action( 'wpr_pre_rollback_table' ); ?>
91
+ <tr>
92
+ <td class="row-title">
93
+ <label for="tablecell"><?php if ( $plugin_rollback == true ) {
94
+ _e( 'Plugin Name:', 'wp-rollback' );
95
+ } else {
96
+ _e( 'Theme Name:', 'wp-rollback' );
97
+ } ?></label>
98
+ </td>
99
+ <td><span class="wpr-plugin-name"></span></td>
100
+ </tr>
101
+ <tr class="alternate">
102
+ <td class="row-title">
103
+ <label for="tablecell"><?php _e( 'Installed Version:', 'wp-rollback' ); ?></label>
104
+ </td>
105
+ <td><span class="wpr-installed-version"></span></td>
106
+ </tr>
107
+ <tr>
108
+ <td class="row-title">
109
+ <label for="tablecell"><?php _e( 'New Version:', 'wp-rollback' ); ?></label>
110
+ </td>
111
+ <td><span class="wpr-new-version"></span></td>
112
+ </tr>
113
+ <?php do_action( 'wpr_post_rollback_table' ); ?>
114
+ </tbody>
115
+ </table>
116
+ </div>
117
+ <div class="wpr-error">
118
+ <p><?php
119
+ _e( '<strong>Notice:</strong> We strongly recommend you perform a test rollback on a staging site and create a complete backup of your WordPress files and database prior to performing a rollback. We are not responsible for any misuse, deletions, white screens, fatal errors, or any other issue arising from using this plugin.', 'wp-rollback' );
120
+ ?></p>
121
+ </div>
122
+ <?php do_action( 'wpr_pre_rollback_buttons' ); ?>
123
+ <input type="submit" value="<?php _e( 'Rollback', 'wp-rollback' ); ?>" class="button-primary wpr-go" />
124
+ <a href="#" class="button wpr-close"><?php _e( 'Cancel', 'wp-rollback' ); ?></a>
125
+ <?php do_action( 'wpr_post_rollback_buttons' ); ?>
126
+ </div>
127
+ </div>
128
+
129
+ </form>
130
+
131
  </div>
languages/wp-rollback.pot ADDED
@@ -0,0 +1,104 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (C) 2016 WP Rollback
2
+ # This file is distributed under the same license as the WP Rollback package.
3
+ msgid ""
4
+ msgstr ""
5
+ "Project-Id-Version: WP Rollback\n"
6
+ "Report-Msgid-Bugs-To: https://github.com/WordImpress/WP-Rollback\n"
7
+ "MIME-Version: 1.0\n"
8
+ "Content-Type: text/plain; charset=UTF-8\n"
9
+ "Content-Transfer-Encoding: 8bit\n"
10
+ "PO-Revision-Date: 2016-MO-DA HO:MI+ZONE\n"
11
+ "Language-Team: WordImpress <info@wordimpress.com>\n"
12
+ "X-Poedit-Basepath: ..\n"
13
+ "X-Poedit-SourceCharset: UTF-8\n"
14
+ "X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
15
+ "X-Poedit-SearchPath-0: .\n"
16
+ "X-Poedit-SearchPathExcluded-0: *.js\n"
17
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
18
+ #: includes/rollback-action.php:35
19
+ msgid "This rollback request is a missing proper query string. Please contact support."
20
+ msgstr ""
21
+
22
+ #: includes/rollback-menu.php:12
23
+ msgid "WP Rollback is missing necessary parameters to continue. Please contact support."
24
+ msgstr ""
25
+
26
+ #: includes/rollback-menu.php:24
27
+ msgid "WP Rollback"
28
+ msgstr ""
29
+
30
+ #: includes/rollback-menu.php:27
31
+ msgid "Please select which %1$s version you would like to rollback to from the releases listed below. You currently have version %2$s installed of %3$s."
32
+ msgstr ""
33
+
34
+ #: includes/rollback-menu.php:27
35
+ msgid "theme"
36
+ msgstr ""
37
+
38
+ #: includes/rollback-menu.php:27
39
+ msgid "plugin"
40
+ msgstr ""
41
+
42
+ #: includes/rollback-menu.php:65, includes/rollback-menu.php:123, wp-rollback.php:244, wp-rollback.php:510, wp-rollback.php:510, wp-rollback.php:572
43
+ msgid "Rollback"
44
+ msgstr ""
45
+
46
+ #: includes/rollback-menu.php:66, includes/rollback-menu.php:124
47
+ msgid "Cancel"
48
+ msgstr ""
49
+
50
+ #: includes/rollback-menu.php:84
51
+ msgid "Are you sure you want to perform the following rollback?"
52
+ msgstr ""
53
+
54
+ #: includes/rollback-menu.php:94
55
+ msgid "Plugin Name:"
56
+ msgstr ""
57
+
58
+ #: includes/rollback-menu.php:96
59
+ msgid "Theme Name:"
60
+ msgstr ""
61
+
62
+ #: includes/rollback-menu.php:103
63
+ msgid "Installed Version:"
64
+ msgstr ""
65
+
66
+ #: includes/rollback-menu.php:109
67
+ msgid "New Version:"
68
+ msgstr ""
69
+
70
+ #: includes/rollback-menu.php:119
71
+ msgid "<strong>Notice:</strong> We strongly recommend you perform a test rollback on a staging site and create a complete backup of your WordPress files and database prior to performing a rollback. We are not responsible for any misuse, deletions, white screens, fatal errors, or any other issue arising from using this plugin."
72
+ msgstr ""
73
+
74
+ #: wp-rollback.php:159, wp-rollback.php:171
75
+ msgid "Cheatin&#8217; huh?"
76
+ msgstr ""
77
+
78
+ #: wp-rollback.php:245
79
+ msgid "No Rollback Available: This is a non-WordPress.org theme."
80
+ msgstr ""
81
+
82
+ #: wp-rollback.php:246
83
+ msgid "Loading..."
84
+ msgstr ""
85
+
86
+ #: wp-rollback.php:275
87
+ msgid "Please select a version number to perform a rollback."
88
+ msgstr ""
89
+
90
+ #: wp-rollback.php:321
91
+ msgid "You do not have sufficient permissions to perform rollbacks for this site."
92
+ msgstr ""
93
+
94
+ #: wp-rollback.php:452
95
+ msgid "Installed Version"
96
+ msgstr ""
97
+
98
+ #: wp-rollback.php:685
99
+ msgid "An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href=\"https://wordpress.org/support/\">support forums</a>."
100
+ msgstr ""
101
+
102
+ #: wp-rollback.php:685
103
+ msgid "(WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.)"
104
+ msgstr ""
languages/wpr-pt_BR.mo DELETED
Binary file
languages/wpr-pt_BR.po DELETED
@@ -1,140 +0,0 @@
1
- msgid ""
2
- msgstr ""
3
- "Project-Id-Version: WP Rollback\n"
4
- "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: Sat Jul 04 2015 00:27:38 GMT-0300 (BRT)\n"
6
- "PO-Revision-Date: 2015-07-04 00:46-0300\n"
7
- "Last-Translator: Rafael Funchal <rafaelfunchal@gmail.com>\n"
8
- "Language-Team: \n"
9
- "Language: Portuguese (Brazil)\n"
10
- "Plural-Forms: nplurals=2; plural=n != 1;\n"
11
- "MIME-Version: 1.0\n"
12
- "Content-Type: text/plain; charset=UTF-8\n"
13
- "Content-Transfer-Encoding: 8bit\n"
14
- "X-Poedit-SourceCharset: UTF-8\n"
15
- "X-Poedit-Basepath: .\n"
16
- "X-Poedit-KeywordsList: _:1;gettext:1;dgettext:2;ngettext:1,2;dngettext:2,3;"
17
- "__:1;_e:1;_c:1;_n:1,2;_n_noop:1,2;_nc:1,2;__ngettext:1,2;__ngettext_noop:1,2;"
18
- "_x:1,2c;_ex:1,2c;_nx:1,2,4c;_nx_noop:1,2,3c;_n_js:1,2;_nx_js:1,2,3c;"
19
- "esc_attr__:1;esc_html__:1;esc_attr_e:1;esc_html_e:1;esc_attr_x:1,2c;"
20
- "esc_html_x:1,2c;comments_number_link:2,3;t:1;st:1;trans:1;transChoice:1,2\n"
21
- "X-Loco-Target-Locale: pt_BR\n"
22
- "X-Generator: Poedit 1.5.4\n"
23
- "X-Poedit-SearchPath-0: ..\n"
24
-
25
- #: ../wp-rollback.php:207 ../wp-rollback.php:461 ../wp- rollback.php:522
26
- #: ../includes/rollback-menu.php:63 ../includes/rollback-menu. php:121
27
- msgid "Rollback"
28
- msgstr "Restaurar"
29
-
30
- #: ../wp-rollback.php:208
31
- msgid "No Rollback Available: This is a non-WordPress.org theme."
32
- msgstr ""
33
- "Nenhum ponto de restauração disponível: Esse não é um tema do WordPress.org."
34
-
35
- #: ../wp-rollback.php:209
36
- msgid "Loading..."
37
- msgstr "Carregando..."
38
-
39
- #: ../wp-rollback.php:228
40
- msgid "Please select a version number to perform a rollback."
41
- msgstr "Por favor, selecione um número de versão para ser restaurada."
42
-
43
- #: ../wp-rollback.php:276
44
- msgid ""
45
- "You do not have sufficient permissions to perform rollbacks for this site."
46
- msgstr ""
47
- "Você não tem permissão suficiente para concluir restaurações nesse site."
48
-
49
- #: ../wp-rollback.php:405
50
- msgid "Installed Version"
51
- msgstr "Versão instalada"
52
-
53
- #: ../wp-rollback.php:634
54
- msgid ""
55
- "An unexpected error occurred. Something may be wrong with WordPress.org or "
56
- "this server&#8217;s configuration. If you continue to have problems, please "
57
- "try the <a href=\"https://wordpress.org/support/\">support forums</a>."
58
- msgstr ""
59
- "Ocorreu um erro inesperado. Há algo errado no WordPress.org ou nas "
60
- "configurações do seu servidor. Caso você continue a ter problemas, por "
61
- "favor, entre em contato pelo \n"
62
- "<a href=\"https://wordpress.org/support/\">fórum de suporte</a>."
63
-
64
- #: ../wp-rollback.php:634
65
- msgid ""
66
- "(WordPress could not establish a secure connection to WordPress.org. Please "
67
- "contact your server administrator.)"
68
- msgstr ""
69
- "(WordPress não conseguiu estabelecer uma conexão segura com WordPress.org. "
70
- "Por favor, entre em contato com o administrador do seu servidor.)"
71
-
72
- #: ../includes/rollback-action.php:35
73
- msgid ""
74
- "This rollback request is missing proper query string. Please contact support."
75
- msgstr ""
76
- "Está faltando uma query string nessa requisição de restauração. Por favor, "
77
- "entre em contato com o suporte."
78
-
79
- #: ../includes/rollback-menu.php:12
80
- msgid ""
81
- "WP Rollback is missing necessary parameters to continue. Please contact "
82
- "support."
83
- msgstr ""
84
- "WP Rollback necessita de alguns parâmetros para continuar. Por favor, entre "
85
- "em contato com o suporte."
86
-
87
- #: ../includes/rollback-menu.php:23
88
- msgid "WP Rollback"
89
- msgstr "WP Rollback"
90
-
91
- #: ../includes/rollback-menu.php:25
92
- #, php-format
93
- msgid ""
94
- "Please select which %1$s version you would like to rollback to from the "
95
- "releases listed below. You currently have version %2$s installed of %3$s."
96
- msgstr ""
97
- "Por favor, selecione abaixo qual versão do %1$s. Atualmente você tem a "
98
- "versão %2$s instalada do %3$s."
99
-
100
- #: ../includes/rollback-menu.php:64 ../includes/rollback-menu.php:122
101
- msgid "Cancel"
102
- msgstr "Cancelar"
103
-
104
- #: ../includes/rollback-menu.php:82
105
- msgid "Are you sure you want to perform the following rollback?"
106
- msgstr "Você tem certeza que deseja restaurar os seguintes itens?"
107
-
108
- #: ../includes/rollback-menu.php:92
109
- msgid "Plugin Name:"
110
- msgstr "Nome do plugin:"
111
-
112
- #: ../includes/rollback-menu.php:94
113
- msgid "Theme Name:"
114
- msgstr "Nome do tema:"
115
-
116
- #: ../includes/rollback-menu.php:101
117
- msgid "Installed Version:"
118
- msgstr "Versão instalada:"
119
-
120
- #: ../includes/rollback-menu.php:107
121
- msgid "New Version:"
122
- msgstr "Nova versão:"
123
-
124
- #: ../includes/rollback-menu.php:117
125
- msgid ""
126
- "<strong>Notice:</strong> We strongly recommend you perform a test rollback "
127
- "on a staging site and create a complete backup of your WordPress files and "
128
- "database prior to performing a rollback. We are not responsible for any "
129
- "misuse, deletions, white screens, fatal errors, or any other issue arising "
130
- "from using this plugin."
131
- msgstr ""
132
- "<strong>Nota:</strong> Nós recomendamos que você teste em um ambiente local "
133
- "e crie um backup completo dos seus arquivos do WordPress e do banco de dados "
134
- "antes de prosseguir com a restauração. Nós não nos responsabilizamos por "
135
- "qualquer erro, apagamento, tela branca, erro fatal ou qualquer problema "
136
- "ocasionado pelo uso desse plugin. "
137
-
138
- #: ../wp-rollback.php:122 ../wp-rollback.php:134
139
- msgid "Cheatin&#8217; huh?"
140
- msgstr "Trapaceando né?"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
languages/wpr-pt_PT.mo DELETED
Binary file
languages/wpr-pt_PT.po DELETED
@@ -1,140 +0,0 @@
1
- msgid ""
2
- msgstr ""
3
- "Project-Id-Version: WP Rollback\n"
4
- "POT-Creation-Date: 2015-07-29 15:50+0100\n"
5
- "PO-Revision-Date: 2015-07-29 16:03+0100\n"
6
- "Last-Translator: Pedro Mendonça <ped.gaspar@gmail.com>\n"
7
- "Language-Team: Pedro Mendonça <ped.gaspar@gmail.com>\n"
8
- "Language: pt_PT\n"
9
- "MIME-Version: 1.0\n"
10
- "Content-Type: text/plain; charset=UTF-8\n"
11
- "Content-Transfer-Encoding: 8bit\n"
12
- "X-Generator: Poedit 1.8.3\n"
13
- "X-Poedit-Basepath: ..\n"
14
- "X-Poedit-SourceCharset: UTF-8\n"
15
- "X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;"
16
- "esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;"
17
- "_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
18
- "Plural-Forms: nplurals=2; plural=(n != 1);\n"
19
- "X-Poedit-SearchPath-0: .\n"
20
- "X-Poedit-SearchPathExcluded-0: *.js\n"
21
-
22
- #: includes/rollback-action.php:35
23
- msgid ""
24
- "This rollback request is missing proper query string. Please contact support."
25
- msgstr ""
26
- "Este pedido de reversão não tem os valores de consulta adequados. Por favor "
27
- "contacte o suporte."
28
-
29
- #: includes/rollback-menu.php:12
30
- msgid ""
31
- "WP Rollback is missing necessary parameters to continue. Please contact "
32
- "support."
33
- msgstr ""
34
- "O WP Rollback não tem os parâmetros necessários para continuar. Por favor "
35
- "contacte o suporte."
36
-
37
- #: includes/rollback-menu.php:23
38
- msgid "WP Rollback"
39
- msgstr "WP Rollback"
40
-
41
- #: includes/rollback-menu.php:25
42
- #, php-format
43
- msgid ""
44
- "Please select which %1$s version you would like to rollback to from the "
45
- "releases listed below. You currently have version %2$s installed of %3$s."
46
- msgstr ""
47
- "Por favor seleccione da lista abaixo qual a versão do %1$s para que pretende "
48
- "reverter. Actualmente tem instalada a versão %2$s de %3$s."
49
-
50
- #: includes/rollback-menu.php:63 includes/rollback-menu.php:121
51
- #: wp-rollback.php:207 wp-rollback.php:461 wp-rollback.php:522
52
- msgid "Rollback"
53
- msgstr "Reverter"
54
-
55
- #: includes/rollback-menu.php:64 includes/rollback-menu.php:122
56
- msgid "Cancel"
57
- msgstr "Cancelar"
58
-
59
- #: includes/rollback-menu.php:82
60
- msgid "Are you sure you want to perform the following rollback?"
61
- msgstr "Tem a certeza que pretende fazer esta reversão?"
62
-
63
- #: includes/rollback-menu.php:92
64
- msgid "Plugin Name:"
65
- msgstr "Nome do plugin:"
66
-
67
- #: includes/rollback-menu.php:94
68
- msgid "Theme Name:"
69
- msgstr "Nome do tema:"
70
-
71
- #: includes/rollback-menu.php:101
72
- msgid "Installed Version:"
73
- msgstr "Versão instalada:"
74
-
75
- #: includes/rollback-menu.php:107
76
- msgid "New Version:"
77
- msgstr "Nova versão:"
78
-
79
- #: includes/rollback-menu.php:117
80
- msgid ""
81
- "<strong>Notice:</strong> We strongly recommend you perform a test rollback "
82
- "on a staging site and create a complete backup of your WordPress files and "
83
- "database prior to performing a rollback. We are not responsible for any "
84
- "misuse, deletions, white screens, fatal errors, or any other issue arising "
85
- "from using this plugin."
86
- msgstr ""
87
- "<strong>Nota:</strong> recomendamos que faça um teste da reversão num site "
88
- "de testes e crie uma cópia de segurança completa dos ficheiros do seu "
89
- "WordPress e base de dados antes de fazer uma reversão. Não somos "
90
- "responsáveis por qualquer má utilização, eliminação, ecrãs em branco, erros "
91
- "fatais ou quaisquer problemas que decorram da utilização deste plugin."
92
-
93
- #: wp-rollback.php:122 wp-rollback.php:134
94
- msgid "Cheatin&#8217; huh?"
95
- msgstr "A fazer batota hein?"
96
-
97
- #: wp-rollback.php:208
98
- msgid "No Rollback Available: This is a non-WordPress.org theme."
99
- msgstr "Sem reversão disponível: este tema não é do WordPress.org."
100
-
101
- #: wp-rollback.php:209
102
- msgid "Loading..."
103
- msgstr "A carregar..."
104
-
105
- #: wp-rollback.php:228
106
- msgid "Please select a version number to perform a rollback."
107
- msgstr "Por favor seleccione o número da versão para a qual pretende reverter."
108
-
109
- #: wp-rollback.php:276
110
- msgid ""
111
- "You do not have sufficient permissions to perform rollbacks for this site."
112
- msgstr "Não tem permissões suficientes para fazer reversões neste site."
113
-
114
- #: wp-rollback.php:405
115
- msgid "Installed Version"
116
- msgstr "Versão instalada"
117
-
118
- #: wp-rollback.php:634
119
- msgid ""
120
- "An unexpected error occurred. Something may be wrong with WordPress.org or "
121
- "this server&#8217;s configuration. If you continue to have problems, please "
122
- "try the <a href=\"https://wordpress.org/support/\">support forums</a>."
123
- msgstr ""
124
- "Ocorreu um erro inesperado. Algo pode errado no WordPress.org ou na "
125
- "configuração deste servidor. Se continuar a ter problemas, por favor tente "
126
- "os <a href=\"https://wordpress.org/support/\">fóruns de suporte</a>."
127
-
128
- #: wp-rollback.php:634
129
- msgid ""
130
- "(WordPress could not establish a secure connection to WordPress.org. Please "
131
- "contact your server administrator.)"
132
- msgstr ""
133
- "(O WordPress não pôde estabelecer uma ligação segura com WordPress.org. "
134
- "Contacte com o administrador do seu servidor.)"
135
-
136
- #~ msgid "theme"
137
- #~ msgstr "tema"
138
-
139
- #~ msgid "plugin"
140
- #~ msgstr "plugin"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
languages/wpr-ru_RU.mo DELETED
Binary file
languages/wpr-ru_RU.po DELETED
@@ -1,138 +0,0 @@
1
- msgid ""
2
- msgstr ""
3
- "Project-Id-Version: WP Rollback ru_RU\n"
4
- "POT-Creation-Date: 2015-05-25 06:50+0300\n"
5
- "PO-Revision-Date: 2015-05-25 07:04+0300\n"
6
- "Last-Translator: Flector <rlector@gmail.com>\n"
7
- "Language-Team: Flector <rlector@gmail.com>\n"
8
- "Language: ru_RU\n"
9
- "MIME-Version: 1.0\n"
10
- "Content-Type: text/plain; charset=UTF-8\n"
11
- "Content-Transfer-Encoding: 8bit\n"
12
- "X-Generator: Poedit 1.8\n"
13
- "X-Poedit-Basepath: ..\n"
14
- "X-Poedit-SourceCharset: UTF-8\n"
15
- "X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;"
16
- "esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;"
17
- "_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
18
- "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
19
- "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
20
- "X-Poedit-SearchPath-0: .\n"
21
- "X-Poedit-SearchPathExcluded-0: *.js\n"
22
-
23
- #: includes/rollback-action.php:35
24
- msgid ""
25
- "This rollback request is missing proper query string. Please contact support."
26
- msgstr ""
27
- "Этот откат требует правильную строку запроса. Пожалуйста, свяжитесь с "
28
- "автором плагина."
29
-
30
- #: includes/rollback-menu.php:12
31
- msgid ""
32
- "WP Rollback is missing necessary parameters to continue. Please contact "
33
- "support."
34
- msgstr ""
35
- "WP Rollback не может работать, так как неизвестны необходимые параметры. "
36
- "<br /> Пожалуйста, свяжитесь с поддержкой. <br /><strong>Замечание:</strong> "
37
- "ссылку \"Откат\" необходимо нажимать только на странице плагинов или тем."
38
-
39
- #: includes/rollback-menu.php:23
40
- msgid "WP Rollback"
41
- msgstr "WP Rollback"
42
-
43
- #: includes/rollback-menu.php:25
44
- #, php-format
45
- msgid ""
46
- "Please select which %1$s version you would like to rollback to from the "
47
- "releases listed below. You currently have version %2$s installed of %3$s."
48
- msgstr ""
49
- "Пожалуйста выберите версию<span style=\"display:none;\">%1$s</span>, на "
50
- "которую вы хотите откатиться. <br /> На данный момент вы используете %3$s "
51
- "версии %2$s."
52
-
53
- #: includes/rollback-menu.php:63 includes/rollback-menu.php:121
54
- #: wp-rollback.php:206 wp-rollback.php:450 wp-rollback.php:510
55
- msgid "Rollback"
56
- msgstr "Откат"
57
-
58
- #: includes/rollback-menu.php:64 includes/rollback-menu.php:122
59
- msgid "Cancel"
60
- msgstr "Отмена"
61
-
62
- #: includes/rollback-menu.php:82
63
- msgid "Are you sure you want to perform the following rollback?"
64
- msgstr "Вы уверены, что хотите выполнить этот откат?"
65
-
66
- #: includes/rollback-menu.php:92
67
- msgid "Plugin Name:"
68
- msgstr "Название плагина:"
69
-
70
- #: includes/rollback-menu.php:94
71
- msgid "Theme Name:"
72
- msgstr "Название темы:"
73
-
74
- #: includes/rollback-menu.php:101
75
- msgid "Installed Version:"
76
- msgstr "Установленная версия"
77
-
78
- #: includes/rollback-menu.php:107
79
- msgid "New Version:"
80
- msgstr "Новая версия:"
81
-
82
- #: includes/rollback-menu.php:117
83
- msgid ""
84
- "<strong>Notice:</strong> We strongly recommend you perform a test rollback "
85
- "on a staging site and create a complete backup of your WordPress files and "
86
- "database prior to performing a rollback. We are not responsible for any "
87
- "misuse, deletions, white screens, fatal errors, or any other issue arising "
88
- "from using this plugin."
89
- msgstr ""
90
- "<strong>Внимание:</strong> мы строго рекомендуем вам делать откаты, "
91
- "предварительно сделав бэкап сайта (файлов и базы данных). Мы не отвечаем за "
92
- "любые ошибки, к которым может привести откат на \"глючную\" версию плагина "
93
- "или темы (такое вполне может быть)."
94
-
95
- #: wp-rollback.php:122 wp-rollback.php:134
96
- msgid "Cheatin&#8217; huh?"
97
- msgstr "Хакер, что ли?"
98
-
99
- #: wp-rollback.php:207
100
- msgid "No Rollback Available: This is a non-WordPress.org theme."
101
- msgstr "Откат недоступен. Эта тема не из репозитория WordPress.org."
102
-
103
- #: wp-rollback.php:208
104
- msgid "Loading..."
105
- msgstr "Загрузка..."
106
-
107
- #: wp-rollback.php:227
108
- msgid "Please select a version number to perform a rollback."
109
- msgstr "Пожалуйста выберите версию, на которую вы хотите откатиться."
110
-
111
- #: wp-rollback.php:275
112
- msgid ""
113
- "You do not have sufficient permissions to perform rollbacks for this site."
114
- msgstr ""
115
- "У вас нет необходимых прав, чтобы делать откаты тем и плагинов на этом сайте."
116
-
117
- #: wp-rollback.php:397
118
- msgid "Installed Version"
119
- msgstr "Установленная версия"
120
-
121
- #: wp-rollback.php:622
122
- msgid ""
123
- "An unexpected error occurred. Something may be wrong with WordPress.org or "
124
- "this server&#8217;s configuration. If you continue to have problems, please "
125
- "try the <a href=\"https://wordpress.org/support/\">support forums</a>."
126
- msgstr ""
127
- "Произошла неизвестная ошибка. Что-то не так с сайтом WordPress.org или с "
128
- "настройками вашего сервера. Если эти проблемы не пройдут сами по себе, то "
129
- "попробуйте найти решение на <a href=\"https://ru.forums.wordpress.org/forum/"
130
- "\">форумах поддержки</a>."
131
-
132
- #: wp-rollback.php:622
133
- msgid ""
134
- "(WordPress could not establish a secure connection to WordPress.org. Please "
135
- "contact your server administrator.)"
136
- msgstr ""
137
- "[WordPress не может установить безопасное соединение с WordPress.org. "
138
- "Пожалуйста свяжитесь с администратором вашего сервера.]"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
languages/wpr-sv_SE.mo DELETED
Binary file
languages/wpr-sv_SE.po DELETED
@@ -1,139 +0,0 @@
1
- msgid ""
2
- msgstr ""
3
- "Project-Id-Version: WP Rollback\n"
4
- "POT-Creation-Date: 2015-05-12 14:31-0800\n"
5
- "PO-Revision-Date: 2015-05-15 09:21+0100\n"
6
- "Last-Translator: Peter Nilsson <wpdailythemes@gmail.com>\n"
7
- "Language-Team: WordImpress <info@wordimpress.com>\n"
8
- "MIME-Version: 1.0\n"
9
- "Content-Type: text/plain; charset=UTF-8\n"
10
- "Content-Transfer-Encoding: 8bit\n"
11
- "X-Generator: Poedit 1.7.6\n"
12
- "X-Poedit-Basepath: ..\n"
13
- "X-Poedit-SourceCharset: UTF-8\n"
14
- "X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;"
15
- "esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;"
16
- "_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
17
- "Plural-Forms: nplurals=2; plural=(n != 1);\n"
18
- "Language: sv_SE\n"
19
- "X-Poedit-SearchPath-0: .\n"
20
- "X-Poedit-SearchPathExcluded-0: *.js\n"
21
-
22
- #: includes/rollback-action.php:35
23
- msgid ""
24
- "This rollback request is missing proper query string. Please contact support."
25
- msgstr ""
26
- "Denna återställnings begäran saknar ordentlig frågesträng. Vänligen kontakta "
27
- "support."
28
-
29
- #: includes/rollback-menu.php:12
30
- msgid ""
31
- "WP Rollback is missing necessary parameters to continue. Please contact "
32
- "support."
33
- msgstr ""
34
- "WP Rollback saknar nödvändiga parametrar för att fortsätta. Vänligen "
35
- "kontakta support."
36
-
37
- #: includes/rollback-menu.php:23
38
- msgid "WP Rollback"
39
- msgstr "WP Rollback"
40
-
41
- #: includes/rollback-menu.php:25
42
- #, php-format
43
- msgid ""
44
- "Please select which %1$s version you would like to rollback to from the "
45
- "releases listed below. You currently have version %2$s installed of %3$s."
46
- msgstr ""
47
- "Välj vilken %1$s version du vill ha utföra återställning till från de "
48
- "utgåvor som anges nedan. Du har för närvarande version %2$s installerat av "
49
- "%3$s."
50
-
51
- #: includes/rollback-menu.php:63 includes/rollback-menu.php:121
52
- #: wp-rollback.php:211 wp-rollback.php:455 wp-rollback.php:515
53
- msgid "Rollback"
54
- msgstr "Återställning"
55
-
56
- #: includes/rollback-menu.php:64 includes/rollback-menu.php:122
57
- msgid "Cancel"
58
- msgstr "Avbryt"
59
-
60
- #: includes/rollback-menu.php:82
61
- msgid "Are you sure you want to perform the following rollback?"
62
- msgstr "Är du säker du vill utföra följande återställning?"
63
-
64
- #: includes/rollback-menu.php:92
65
- msgid "Plugin Name:"
66
- msgstr "Namn på Plugin:"
67
-
68
- #: includes/rollback-menu.php:94
69
- msgid "Theme Name:"
70
- msgstr "Namn på Tema:"
71
-
72
- #: includes/rollback-menu.php:101
73
- msgid "Installed Version:"
74
- msgstr "Installerad version:"
75
-
76
- #: includes/rollback-menu.php:107
77
- msgid "New Version:"
78
- msgstr "Ny Version:"
79
-
80
- #: includes/rollback-menu.php:117
81
- msgid ""
82
- "<strong>Notice:</strong> We strongly recommend you perform a test rollback "
83
- "on a staging site and create a complete backup of your WordPress files and "
84
- "database prior to performing a rollback. We are not responsible for any "
85
- "misuse, deletions, white screens, fatal errors, or any other issue arising "
86
- "from using this plugin."
87
- msgstr ""
88
- "<strong>Meddelande:</strong> Vi rekommenderar att du utför en test "
89
- "återställning till en mellanlagringsplats och skapar en fullständig "
90
- "säkerhetskopia av dina WordPress-filer och databas innan du utför en "
91
- "återställning. Vi ansvarar inte för missbruk, borttagningar, vita skärmar, "
92
- "allvarliga fel eller andra problem som kan uppkomma från att använda detta "
93
- "plugin."
94
-
95
- #: wp-rollback.php:122 wp-rollback.php:134
96
- msgid "Cheatin&#8217; huh?"
97
- msgstr "Fuskar du?"
98
-
99
- #: wp-rollback.php:212
100
- msgid "No Rollback Available: This is a non-WordPress.org theme."
101
- msgstr ""
102
- "Ingen återställning tillgänglig: Detta är inget tema ifrån WordPress.org."
103
-
104
- #: wp-rollback.php:213
105
- msgid "Loading..."
106
- msgstr "Laddar..."
107
-
108
- #: wp-rollback.php:232
109
- msgid "Please select a version number to perform a rollback."
110
- msgstr "Välj ett versions nummer för att utföra en återställning."
111
-
112
- #: wp-rollback.php:280
113
- msgid ""
114
- "You do not have sufficient permissions to perform rollbacks for this site."
115
- msgstr ""
116
- "Ni har inte tillräckligt med rättigheter för att utföra återställningar för "
117
- "den här sajten. "
118
-
119
- #: wp-rollback.php:402
120
- msgid "Installed Version"
121
- msgstr "Installerad Version"
122
-
123
- #: wp-rollback.php:627
124
- msgid ""
125
- "An unexpected error occurred. Something may be wrong with WordPress.org or "
126
- "this server&#8217;s configuration. If you continue to have problems, please "
127
- "try the <a href=\"https://wordpress.org/support/\">support forums</a>."
128
- msgstr ""
129
- "Ett oväntat fel inträffade. Något kan vara fel med WordPress.org eller denna "
130
- "server&#8217;s konfiguration. Om du fortsättningsvis har problem kan du "
131
- "felsöka <a href=\"https://wordpress.org/support/\">support forums</a>."
132
-
133
- #: wp-rollback.php:627
134
- msgid ""
135
- "(WordPress could not establish a secure connection to WordPress.org. Please "
136
- "contact your server administrator.)"
137
- msgstr ""
138
- "(WordPress kunde inte etablera en säker koppling till WordPress.org. "
139
- "Kontakta er server administratör.) "
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
languages/wpr.pot DELETED
@@ -1,140 +0,0 @@
1
- #, fuzzy
2
- msgid ""
3
- msgstr ""
4
- "Project-Id-Version: WP Rollback\n"
5
- "POT-Creation-Date: 2015-07-29 09:51-0700\n"
6
- "PO-Revision-Date: 2015-07-29 09:50-0700\n"
7
- "Last-Translator: \n"
8
- "Language-Team: \n"
9
- "MIME-Version: 1.0\n"
10
- "Content-Type: text/plain; charset=UTF-8\n"
11
- "Content-Transfer-Encoding: 8bit\n"
12
- "X-Generator: Poedit 1.8.3\n"
13
- "X-Poedit-Basepath: ..\n"
14
- "X-Poedit-WPHeader: wp-rollback.php\n"
15
- "X-Poedit-SourceCharset: UTF-8\n"
16
- "X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;"
17
- "esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;"
18
- "_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
19
- "X-Poedit-SearchPath-0: .\n"
20
- "X-Poedit-SearchPathExcluded-0: *.js\n"
21
-
22
- #: includes/rollback-action.php:35
23
- msgid ""
24
- "This rollback request is missing proper query string. Please contact support."
25
- msgstr ""
26
-
27
- #: includes/rollback-menu.php:12
28
- msgid ""
29
- "WP Rollback is missing necessary parameters to continue. Please contact "
30
- "support."
31
- msgstr ""
32
-
33
- #. Plugin Name of the plugin/theme
34
- #: includes/rollback-menu.php:24
35
- msgid "WP Rollback"
36
- msgstr ""
37
-
38
- #: includes/rollback-menu.php:27
39
- #, php-format
40
- msgid ""
41
- "Please select which %1$s version you would like to rollback to from the "
42
- "releases listed below. You currently have version %2$s installed of %3$s."
43
- msgstr ""
44
-
45
- #: includes/rollback-menu.php:27
46
- msgid "theme"
47
- msgstr ""
48
-
49
- #: includes/rollback-menu.php:27
50
- msgid "plugin"
51
- msgstr ""
52
-
53
- #: includes/rollback-menu.php:65 includes/rollback-menu.php:123
54
- #: wp-rollback.php:211 wp-rollback.php:469 wp-rollback.php:531
55
- msgid "Rollback"
56
- msgstr ""
57
-
58
- #: includes/rollback-menu.php:66 includes/rollback-menu.php:124
59
- msgid "Cancel"
60
- msgstr ""
61
-
62
- #: includes/rollback-menu.php:84
63
- msgid "Are you sure you want to perform the following rollback?"
64
- msgstr ""
65
-
66
- #: includes/rollback-menu.php:94
67
- msgid "Plugin Name:"
68
- msgstr ""
69
-
70
- #: includes/rollback-menu.php:96
71
- msgid "Theme Name:"
72
- msgstr ""
73
-
74
- #: includes/rollback-menu.php:103
75
- msgid "Installed Version:"
76
- msgstr ""
77
-
78
- #: includes/rollback-menu.php:109
79
- msgid "New Version:"
80
- msgstr ""
81
-
82
- #: includes/rollback-menu.php:119
83
- msgid ""
84
- "<strong>Notice:</strong> We strongly recommend you perform a test rollback "
85
- "on a staging site and create a complete backup of your WordPress files and "
86
- "database prior to performing a rollback. We are not responsible for any "
87
- "misuse, deletions, white screens, fatal errors, or any other issue arising "
88
- "from using this plugin."
89
- msgstr ""
90
-
91
- #: wp-rollback.php:126 wp-rollback.php:138
92
- msgid "Cheatin&#8217; huh?"
93
- msgstr ""
94
-
95
- #: wp-rollback.php:212
96
- msgid "No Rollback Available: This is a non-WordPress.org theme."
97
- msgstr ""
98
-
99
- #: wp-rollback.php:213
100
- msgid "Loading..."
101
- msgstr ""
102
-
103
- #: wp-rollback.php:232
104
- msgid "Please select a version number to perform a rollback."
105
- msgstr ""
106
-
107
- #: wp-rollback.php:281
108
- msgid ""
109
- "You do not have sufficient permissions to perform rollbacks for this site."
110
- msgstr ""
111
-
112
- #: wp-rollback.php:412
113
- msgid "Installed Version"
114
- msgstr ""
115
-
116
- #: wp-rollback.php:643
117
- msgid ""
118
- "An unexpected error occurred. Something may be wrong with WordPress.org or "
119
- "this server&#8217;s configuration. If you continue to have problems, please "
120
- "try the <a href=\"https://wordpress.org/support/\">support forums</a>."
121
- msgstr ""
122
-
123
- #: wp-rollback.php:643
124
- msgid ""
125
- "(WordPress could not establish a secure connection to WordPress.org. Please "
126
- "contact your server administrator.)"
127
- msgstr ""
128
-
129
- #. Plugin URI of the plugin/theme
130
- #. Author URI of the plugin/theme
131
- msgid "http://wordimpress.com"
132
- msgstr ""
133
-
134
- #. Description of the plugin/theme
135
- msgid "Rollback (or forward) any WordPress.org plugin or theme like a boss."
136
- msgstr ""
137
-
138
- #. Author of the plugin/theme
139
- msgid "WordImpress"
140
- msgstr ""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
license.txt CHANGED
@@ -1,281 +1,281 @@
1
- GNU GENERAL PUBLIC LICENSE
2
- Version 2, June 1991
3
-
4
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
5
- 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
6
-
7
- Everyone is permitted to copy and distribute verbatim copies
8
- of this license document, but changing it is not allowed.
9
-
10
- Preamble
11
-
12
- The licenses for most software are designed to take away your
13
- freedom to share and change it. By contrast, the GNU General Public
14
- License is intended to guarantee your freedom to share and change free
15
- software--to make sure the software is free for all its users. This
16
- General Public License applies to most of the Free Software
17
- Foundation's software and to any other program whose authors commit to
18
- using it. (Some other Free Software Foundation software is covered by
19
- the GNU Library General Public License instead.) You can apply it to
20
- your programs, too.
21
-
22
- When we speak of free software, we are referring to freedom, not
23
- price. Our General Public Licenses are designed to make sure that you
24
- have the freedom to distribute copies of free software (and charge for
25
- this service if you wish), that you receive source code or can get it
26
- if you want it, that you can change the software or use pieces of it
27
- in new free programs; and that you know you can do these things.
28
-
29
- To protect your rights, we need to make restrictions that forbid
30
- anyone to deny you these rights or to ask you to surrender the rights.
31
- These restrictions translate to certain responsibilities for you if you
32
- distribute copies of the software, or if you modify it.
33
-
34
- For example, if you distribute copies of such a program, whether
35
- gratis or for a fee, you must give the recipients all the rights that
36
- you have. You must make sure that they, too, receive or can get the
37
- source code. And you must show them these terms so they know their
38
- rights.
39
-
40
- We protect your rights with two steps: (1) copyright the software, and
41
- (2) offer you this license which gives you legal permission to copy,
42
- distribute and/or modify the software.
43
-
44
- Also, for each author's protection and ours, we want to make certain
45
- that everyone understands that there is no warranty for this free
46
- software. If the software is modified by someone else and passed on, we
47
- want its recipients to know that what they have is not the original, so
48
- that any problems introduced by others will not reflect on the original
49
- authors' reputations.
50
-
51
- Finally, any free program is threatened constantly by software
52
- patents. We wish to avoid the danger that redistributors of a free
53
- program will individually obtain patent licenses, in effect making the
54
- program proprietary. To prevent this, we have made it clear that any
55
- patent must be licensed for everyone's free use or not licensed at all.
56
-
57
- The precise terms and conditions for copying, distribution and
58
- modification follow.
59
-
60
- GNU GENERAL PUBLIC LICENSE
61
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
62
-
63
- 0. This License applies to any program or other work which contains
64
- a notice placed by the copyright holder saying it may be distributed
65
- under the terms of this General Public License. The "Program", below,
66
- refers to any such program or work, and a "work based on the Program"
67
- means either the Program or any derivative work under copyright law:
68
- that is to say, a work containing the Program or a portion of it,
69
- either verbatim or with modifications and/or translated into another
70
- language. (Hereinafter, translation is included without limitation in
71
- the term "modification".) Each licensee is addressed as "you".
72
-
73
- Activities other than copying, distribution and modification are not
74
- covered by this License; they are outside its scope. The act of
75
- running the Program is not restricted, and the output from the Program
76
- is covered only if its contents constitute a work based on the
77
- Program (independent of having been made by running the Program).
78
- Whether that is true depends on what the Program does.
79
-
80
- 1. You may copy and distribute verbatim copies of the Program's
81
- source code as you receive it, in any medium, provided that you
82
- conspicuously and appropriately publish on each copy an appropriate
83
- copyright notice and disclaimer of warranty; keep intact all the
84
- notices that refer to this License and to the absence of any warranty;
85
- and give any other recipients of the Program a copy of this License
86
- along with the Program.
87
-
88
- You may charge a fee for the physical act of transferring a copy, and
89
- you may at your option offer warranty protection in exchange for a fee.
90
-
91
- 2. You may modify your copy or copies of the Program or any portion
92
- of it, thus forming a work based on the Program, and copy and
93
- distribute such modifications or work under the terms of Section 1
94
- above, provided that you also meet all of these conditions:
95
-
96
- a) You must cause the modified files to carry prominent notices
97
- stating that you changed the files and the date of any change.
98
-
99
- b) You must cause any work that you distribute or publish, that in
100
- whole or in part contains or is derived from the Program or any
101
- part thereof, to be licensed as a whole at no charge to all third
102
- parties under the terms of this License.
103
-
104
- c) If the modified program normally reads commands interactively
105
- when run, you must cause it, when started running for such
106
- interactive use in the most ordinary way, to print or display an
107
- announcement including an appropriate copyright notice and a
108
- notice that there is no warranty (or else, saying that you provide
109
- a warranty) and that users may redistribute the program under
110
- these conditions, and telling the user how to view a copy of this
111
- License. (Exception: if the Program itself is interactive but
112
- does not normally print such an announcement, your work based on
113
- the Program is not required to print an announcement.)
114
-
115
- These requirements apply to the modified work as a whole. If
116
- identifiable sections of that work are not derived from the Program,
117
- and can be reasonably considered independent and separate works in
118
- themselves, then this License, and its terms, do not apply to those
119
- sections when you distribute them as separate works. But when you
120
- distribute the same sections as part of a whole which is a work based
121
- on the Program, the distribution of the whole must be on the terms of
122
- this License, whose permissions for other licensees extend to the
123
- entire whole, and thus to each and every part regardless of who wrote it.
124
- Thus, it is not the intent of this section to claim rights or contest
125
- your rights to work written entirely by you; rather, the intent is to
126
- exercise the right to control the distribution of derivative or
127
- collective works based on the Program.
128
-
129
- In addition, mere aggregation of another work not based on the Program
130
- with the Program (or with a work based on the Program) on a volume of
131
- a storage or distribution medium does not bring the other work under
132
- the scope of this License.
133
-
134
- 3. You may copy and distribute the Program (or a work based on it,
135
- under Section 2) in object code or executable form under the terms of
136
- Sections 1 and 2 above provided that you also do one of the following:
137
-
138
- a) Accompany it with the complete corresponding machine-readable
139
- source code, which must be distributed under the terms of Sections
140
- 1 and 2 above on a medium customarily used for software interchange; or,
141
-
142
- b) Accompany it with a written offer, valid for at least three
143
- years, to give any third party, for a charge no more than your
144
- cost of physically performing source distribution, a complete
145
- machine-readable copy of the corresponding source code, to be
146
- distributed under the terms of Sections 1 and 2 above on a medium
147
- customarily used for software interchange; or,
148
-
149
- c) Accompany it with the information you received as to the offer
150
- to distribute corresponding source code. (This alternative is
151
- allowed only for noncommercial distribution and only if you
152
- received the program in object code or executable form with such
153
- an offer, in accord with Subsection b above.)
154
-
155
- The source code for a work means the preferred form of the work for
156
- making modifications to it. For an executable work, complete source
157
- code means all the source code for all modules it contains, plus any
158
- associated interface definition files, plus the scripts used to
159
- control compilation and installation of the executable. However, as a
160
- special exception, the source code distributed need not include
161
- anything that is normally distributed (in either source or binary
162
- form) with the major components (compiler, kernel, and so on) of the
163
- operating system on which the executable runs, unless that component
164
- itself accompanies the executable.
165
-
166
- If distribution of executable or object code is made by offering
167
- access to copy from a designated place, then offering equivalent
168
- access to copy the source code from the same place counts as
169
- distribution of the source code, even though third parties are not
170
- compelled to copy the source along with the object code.
171
-
172
- 4. You may not copy, modify, sublicense, or distribute the Program
173
- except as expressly provided under this License. Any attempt
174
- otherwise to copy, modify, sublicense or distribute the Program is
175
- void, and will automatically terminate your rights under this License.
176
- However, parties who have received copies, or rights, from you under
177
- this License will not have their licenses terminated so long as such
178
- parties remain in full compliance.
179
-
180
- 5. You are not required to accept this License, since you have not
181
- signed it. However, nothing else grants you permission to modify or
182
- distribute the Program or its derivative works. These actions are
183
- prohibited by law if you do not accept this License. Therefore, by
184
- modifying or distributing the Program (or any work based on the
185
- Program), you indicate your acceptance of this License to do so, and
186
- all its terms and conditions for copying, distributing or modifying
187
- the Program or works based on it.
188
-
189
- 6. Each time you redistribute the Program (or any work based on the
190
- Program), the recipient automatically receives a license from the
191
- original licensor to copy, distribute or modify the Program subject to
192
- these terms and conditions. You may not impose any further
193
- restrictions on the recipients' exercise of the rights granted herein.
194
- You are not responsible for enforcing compliance by third parties to
195
- this License.
196
-
197
- 7. If, as a consequence of a court judgment or allegation of patent
198
- infringement or for any other reason (not limited to patent issues),
199
- conditions are imposed on you (whether by court order, agreement or
200
- otherwise) that contradict the conditions of this License, they do not
201
- excuse you from the conditions of this License. If you cannot
202
- distribute so as to satisfy simultaneously your obligations under this
203
- License and any other pertinent obligations, then as a consequence you
204
- may not distribute the Program at all. For example, if a patent
205
- license would not permit royalty-free redistribution of the Program by
206
- all those who receive copies directly or indirectly through you, then
207
- the only way you could satisfy both it and this License would be to
208
- refrain entirely from distribution of the Program.
209
-
210
- If any portion of this section is held invalid or unenforceable under
211
- any particular circumstance, the balance of the section is intended to
212
- apply and the section as a whole is intended to apply in other
213
- circumstances.
214
-
215
- It is not the purpose of this section to induce you to infringe any
216
- patents or other property right claims or to contest validity of any
217
- such claims; this section has the sole purpose of protecting the
218
- integrity of the free software distribution system, which is
219
- implemented by public license practices. Many people have made
220
- generous contributions to the wide range of software distributed
221
- through that system in reliance on consistent application of that
222
- system; it is up to the author/donor to decide if he or she is willing
223
- to distribute software through any other system and a licensee cannot
224
- impose that choice.
225
-
226
- This section is intended to make thoroughly clear what is believed to
227
- be a consequence of the rest of this License.
228
-
229
- 8. If the distribution and/or use of the Program is restricted in
230
- certain countries either by patents or by copyrighted interfaces, the
231
- original copyright holder who places the Program under this License
232
- may add an explicit geographical distribution limitation excluding
233
- those countries, so that distribution is permitted only in or among
234
- countries not thus excluded. In such case, this License incorporates
235
- the limitation as if written in the body of this License.
236
-
237
- 9. The Free Software Foundation may publish revised and/or new versions
238
- of the General Public License from time to time. Such new versions will
239
- be similar in spirit to the present version, but may differ in detail to
240
- address new problems or concerns.
241
-
242
- Each version is given a distinguishing version number. If the Program
243
- specifies a version number of this License which applies to it and "any
244
- later version", you have the option of following the terms and conditions
245
- either of that version or of any later version published by the Free
246
- Software Foundation. If the Program does not specify a version number of
247
- this License, you may choose any version ever published by the Free Software
248
- Foundation.
249
-
250
- 10. If you wish to incorporate parts of the Program into other free
251
- programs whose distribution conditions are different, write to the author
252
- to ask for permission. For software which is copyrighted by the Free
253
- Software Foundation, write to the Free Software Foundation; we sometimes
254
- make exceptions for this. Our decision will be guided by the two goals
255
- of preserving the free status of all derivatives of our free software and
256
- of promoting the sharing and reuse of software generally.
257
-
258
- NO WARRANTY
259
-
260
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261
- FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262
- OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263
- PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264
- OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265
- MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266
- TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267
- PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268
- REPAIR OR CORRECTION.
269
-
270
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271
- WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272
- REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273
- INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274
- OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275
- TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276
- YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277
- PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278
- POSSIBILITY OF SUCH DAMAGES.
279
-
280
- END OF TERMS AND CONDITIONS
281
-
1
+ GNU GENERAL PUBLIC LICENSE
2
+ Version 2, June 1991
3
+
4
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
5
+ 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
6
+
7
+ Everyone is permitted to copy and distribute verbatim copies
8
+ of this license document, but changing it is not allowed.
9
+
10
+ Preamble
11
+
12
+ The licenses for most software are designed to take away your
13
+ freedom to share and change it. By contrast, the GNU General Public
14
+ License is intended to guarantee your freedom to share and change free
15
+ software--to make sure the software is free for all its users. This
16
+ General Public License applies to most of the Free Software
17
+ Foundation's software and to any other program whose authors commit to
18
+ using it. (Some other Free Software Foundation software is covered by
19
+ the GNU Library General Public License instead.) You can apply it to
20
+ your programs, too.
21
+
22
+ When we speak of free software, we are referring to freedom, not
23
+ price. Our General Public Licenses are designed to make sure that you
24
+ have the freedom to distribute copies of free software (and charge for
25
+ this service if you wish), that you receive source code or can get it
26
+ if you want it, that you can change the software or use pieces of it
27
+ in new free programs; and that you know you can do these things.
28
+
29
+ To protect your rights, we need to make restrictions that forbid
30
+ anyone to deny you these rights or to ask you to surrender the rights.
31
+ These restrictions translate to certain responsibilities for you if you
32
+ distribute copies of the software, or if you modify it.
33
+
34
+ For example, if you distribute copies of such a program, whether
35
+ gratis or for a fee, you must give the recipients all the rights that
36
+ you have. You must make sure that they, too, receive or can get the
37
+ source code. And you must show them these terms so they know their
38
+ rights.
39
+
40
+ We protect your rights with two steps: (1) copyright the software, and
41
+ (2) offer you this license which gives you legal permission to copy,
42
+ distribute and/or modify the software.
43
+
44
+ Also, for each author's protection and ours, we want to make certain
45
+ that everyone understands that there is no warranty for this free
46
+ software. If the software is modified by someone else and passed on, we
47
+ want its recipients to know that what they have is not the original, so
48
+ that any problems introduced by others will not reflect on the original
49
+ authors' reputations.
50
+
51
+ Finally, any free program is threatened constantly by software
52
+ patents. We wish to avoid the danger that redistributors of a free
53
+ program will individually obtain patent licenses, in effect making the
54
+ program proprietary. To prevent this, we have made it clear that any
55
+ patent must be licensed for everyone's free use or not licensed at all.
56
+
57
+ The precise terms and conditions for copying, distribution and
58
+ modification follow.
59
+
60
+ GNU GENERAL PUBLIC LICENSE
61
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
62
+
63
+ 0. This License applies to any program or other work which contains
64
+ a notice placed by the copyright holder saying it may be distributed
65
+ under the terms of this General Public License. The "Program", below,
66
+ refers to any such program or work, and a "work based on the Program"
67
+ means either the Program or any derivative work under copyright law:
68
+ that is to say, a work containing the Program or a portion of it,
69
+ either verbatim or with modifications and/or translated into another
70
+ language. (Hereinafter, translation is included without limitation in
71
+ the term "modification".) Each licensee is addressed as "you".
72
+
73
+ Activities other than copying, distribution and modification are not
74
+ covered by this License; they are outside its scope. The act of
75
+ running the Program is not restricted, and the output from the Program
76
+ is covered only if its contents constitute a work based on the
77
+ Program (independent of having been made by running the Program).
78
+ Whether that is true depends on what the Program does.
79
+
80
+ 1. You may copy and distribute verbatim copies of the Program's
81
+ source code as you receive it, in any medium, provided that you
82
+ conspicuously and appropriately publish on each copy an appropriate
83
+ copyright notice and disclaimer of warranty; keep intact all the
84
+ notices that refer to this License and to the absence of any warranty;
85
+ and give any other recipients of the Program a copy of this License
86
+ along with the Program.
87
+
88
+ You may charge a fee for the physical act of transferring a copy, and
89
+ you may at your option offer warranty protection in exchange for a fee.
90
+
91
+ 2. You may modify your copy or copies of the Program or any portion
92
+ of it, thus forming a work based on the Program, and copy and
93
+ distribute such modifications or work under the terms of Section 1
94
+ above, provided that you also meet all of these conditions:
95
+
96
+ a) You must cause the modified files to carry prominent notices
97
+ stating that you changed the files and the date of any change.
98
+
99
+ b) You must cause any work that you distribute or publish, that in
100
+ whole or in part contains or is derived from the Program or any
101
+ part thereof, to be licensed as a whole at no charge to all third
102
+ parties under the terms of this License.
103
+
104
+ c) If the modified program normally reads commands interactively
105
+ when run, you must cause it, when started running for such
106
+ interactive use in the most ordinary way, to print or display an
107
+ announcement including an appropriate copyright notice and a
108
+ notice that there is no warranty (or else, saying that you provide
109
+ a warranty) and that users may redistribute the program under
110
+ these conditions, and telling the user how to view a copy of this
111
+ License. (Exception: if the Program itself is interactive but
112
+ does not normally print such an announcement, your work based on
113
+ the Program is not required to print an announcement.)
114
+
115
+ These requirements apply to the modified work as a whole. If
116
+ identifiable sections of that work are not derived from the Program,
117
+ and can be reasonably considered independent and separate works in
118
+ themselves, then this License, and its terms, do not apply to those
119
+ sections when you distribute them as separate works. But when you
120
+ distribute the same sections as part of a whole which is a work based
121
+ on the Program, the distribution of the whole must be on the terms of
122
+ this License, whose permissions for other licensees extend to the
123
+ entire whole, and thus to each and every part regardless of who wrote it.
124
+ Thus, it is not the intent of this section to claim rights or contest
125
+ your rights to work written entirely by you; rather, the intent is to
126
+ exercise the right to control the distribution of derivative or
127
+ collective works based on the Program.
128
+
129
+ In addition, mere aggregation of another work not based on the Program
130
+ with the Program (or with a work based on the Program) on a volume of
131
+ a storage or distribution medium does not bring the other work under
132
+ the scope of this License.
133
+
134
+ 3. You may copy and distribute the Program (or a work based on it,
135
+ under Section 2) in object code or executable form under the terms of
136
+ Sections 1 and 2 above provided that you also do one of the following:
137
+
138
+ a) Accompany it with the complete corresponding machine-readable
139
+ source code, which must be distributed under the terms of Sections
140
+ 1 and 2 above on a medium customarily used for software interchange; or,
141
+
142
+ b) Accompany it with a written offer, valid for at least three
143
+ years, to give any third party, for a charge no more than your
144
+ cost of physically performing source distribution, a complete
145
+ machine-readable copy of the corresponding source code, to be
146
+ distributed under the terms of Sections 1 and 2 above on a medium
147
+ customarily used for software interchange; or,
148
+
149
+ c) Accompany it with the information you received as to the offer
150
+ to distribute corresponding source code. (This alternative is
151
+ allowed only for noncommercial distribution and only if you
152
+ received the program in object code or executable form with such
153
+ an offer, in accord with Subsection b above.)
154
+
155
+ The source code for a work means the preferred form of the work for
156
+ making modifications to it. For an executable work, complete source
157
+ code means all the source code for all modules it contains, plus any
158
+ associated interface definition files, plus the scripts used to
159
+ control compilation and installation of the executable. However, as a
160
+ special exception, the source code distributed need not include
161
+ anything that is normally distributed (in either source or binary
162
+ form) with the major components (compiler, kernel, and so on) of the
163
+ operating system on which the executable runs, unless that component
164
+ itself accompanies the executable.
165
+
166
+ If distribution of executable or object code is made by offering
167
+ access to copy from a designated place, then offering equivalent
168
+ access to copy the source code from the same place counts as
169
+ distribution of the source code, even though third parties are not
170
+ compelled to copy the source along with the object code.
171
+
172
+ 4. You may not copy, modify, sublicense, or distribute the Program
173
+ except as expressly provided under this License. Any attempt
174
+ otherwise to copy, modify, sublicense or distribute the Program is
175
+ void, and will automatically terminate your rights under this License.
176
+ However, parties who have received copies, or rights, from you under
177
+ this License will not have their licenses terminated so long as such
178
+ parties remain in full compliance.
179
+
180
+ 5. You are not required to accept this License, since you have not
181
+ signed it. However, nothing else grants you permission to modify or
182
+ distribute the Program or its derivative works. These actions are
183
+ prohibited by law if you do not accept this License. Therefore, by
184
+ modifying or distributing the Program (or any work based on the
185
+ Program), you indicate your acceptance of this License to do so, and
186
+ all its terms and conditions for copying, distributing or modifying
187
+ the Program or works based on it.
188
+
189
+ 6. Each time you redistribute the Program (or any work based on the
190
+ Program), the recipient automatically receives a license from the
191
+ original licensor to copy, distribute or modify the Program subject to
192
+ these terms and conditions. You may not impose any further
193
+ restrictions on the recipients' exercise of the rights granted herein.
194
+ You are not responsible for enforcing compliance by third parties to
195
+ this License.
196
+
197
+ 7. If, as a consequence of a court judgment or allegation of patent
198
+ infringement or for any other reason (not limited to patent issues),
199
+ conditions are imposed on you (whether by court order, agreement or
200
+ otherwise) that contradict the conditions of this License, they do not
201
+ excuse you from the conditions of this License. If you cannot
202
+ distribute so as to satisfy simultaneously your obligations under this
203
+ License and any other pertinent obligations, then as a consequence you
204
+ may not distribute the Program at all. For example, if a patent
205
+ license would not permit royalty-free redistribution of the Program by
206
+ all those who receive copies directly or indirectly through you, then
207
+ the only way you could satisfy both it and this License would be to
208
+ refrain entirely from distribution of the Program.
209
+
210
+ If any portion of this section is held invalid or unenforceable under
211
+ any particular circumstance, the balance of the section is intended to
212
+ apply and the section as a whole is intended to apply in other
213
+ circumstances.
214
+
215
+ It is not the purpose of this section to induce you to infringe any
216
+ patents or other property right claims or to contest validity of any
217
+ such claims; this section has the sole purpose of protecting the
218
+ integrity of the free software distribution system, which is
219
+ implemented by public license practices. Many people have made
220
+ generous contributions to the wide range of software distributed
221
+ through that system in reliance on consistent application of that
222
+ system; it is up to the author/donor to decide if he or she is willing
223
+ to distribute software through any other system and a licensee cannot
224
+ impose that choice.
225
+
226
+ This section is intended to make thoroughly clear what is believed to
227
+ be a consequence of the rest of this License.
228
+
229
+ 8. If the distribution and/or use of the Program is restricted in
230
+ certain countries either by patents or by copyrighted interfaces, the
231
+ original copyright holder who places the Program under this License
232
+ may add an explicit geographical distribution limitation excluding
233
+ those countries, so that distribution is permitted only in or among
234
+ countries not thus excluded. In such case, this License incorporates
235
+ the limitation as if written in the body of this License.
236
+
237
+ 9. The Free Software Foundation may publish revised and/or new versions
238
+ of the General Public License from time to time. Such new versions will
239
+ be similar in spirit to the present version, but may differ in detail to
240
+ address new problems or concerns.
241
+
242
+ Each version is given a distinguishing version number. If the Program
243
+ specifies a version number of this License which applies to it and "any
244
+ later version", you have the option of following the terms and conditions
245
+ either of that version or of any later version published by the Free
246
+ Software Foundation. If the Program does not specify a version number of
247
+ this License, you may choose any version ever published by the Free Software
248
+ Foundation.
249
+
250
+ 10. If you wish to incorporate parts of the Program into other free
251
+ programs whose distribution conditions are different, write to the author
252
+ to ask for permission. For software which is copyrighted by the Free
253
+ Software Foundation, write to the Free Software Foundation; we sometimes
254
+ make exceptions for this. Our decision will be guided by the two goals
255
+ of preserving the free status of all derivatives of our free software and
256
+ of promoting the sharing and reuse of software generally.
257
+
258
+ NO WARRANTY
259
+
260
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261
+ FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262
+ OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263
+ PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264
+ OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266
+ TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267
+ PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268
+ REPAIR OR CORRECTION.
269
+
270
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272
+ REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273
+ INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274
+ OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275
+ TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276
+ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277
+ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278
+ POSSIBILITY OF SUCH DAMAGES.
279
+
280
+ END OF TERMS AND CONDITIONS
281
+
readme.txt CHANGED
@@ -1,147 +1,152 @@
1
- === WP Rollback ===
2
- Contributors: wordimpress, dlocc, drrobotnik, webdevmattcrom
3
- Tags: rollback, revert, downgrade, version, plugins, themes, version, versions, backup, backups, revision, revisions
4
- Requires at least: 4.0
5
- Donate Link: https://wordimpress.com
6
- Tested up to: 4.5
7
- Stable tag: 1.3
8
- License: GPLv3
9
- License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
-
11
- Rollback (or forward) any WordPress.org plugin or theme like a boss.
12
-
13
- == Description ==
14
-
15
- Quickly and easily rollback any theme or plugin from WordPress.org to any previous (or newer) version without any of the manual fuss. Works just like the plugin updater, except you're rolling back (or forward) to a specific version. No need for manually downloading and FTPing the files or learning Subversion. This plugin takes care of the trouble for you.
16
-
17
- = Rollback WordPress.org Plugins and Themes =
18
-
19
- While it's considered best practice to always keep your WordPress plugins and themes updated, we understand there are times you may need to quickly revert to a previous version. This plugin makes that process as easy as a few mouse clicks. Simply select the version of the plugin or theme that you'd like to rollback to, confirm, and in a few moments you'll be using the version requested. No more fumbling to find the version, downloading, unzipping, FTPing, learning Subversion or hair pulling.
20
-
21
- = Muy Importante (Very Important): Always Test and Backup =
22
-
23
- **Important Disclaimer:** This plugin is not intended to be used without first taking the proper precautions to ensure zero data loss or site downtime. Always be sure you have first tested the rollback on a staging or development site prior to using WP Rollback on a live site.
24
-
25
- We provide no (zero) assurances, guarantees, or warrenties that the plugin, theme, or WordPress version you are downgrading to will work as you expect. Use this plugin at your own risk.
26
-
27
- = Translation Ready =
28
-
29
- Do you speak another language? Want to contribute in a meaninful way to WP Rollback? There's no better way than to help us translate the plugin. This plugin is translation ready. Simply use the wp-rollback.pot file and your favorite translation tool. Once finished, please reach out to us on the WordPress.org forums or better yet, submit a pull request on the [Github Repo](https://github.com/WordImpress/WP-Rollback/).
30
-
31
- = Support and Documentation =
32
-
33
- We answer all support requests [on the WordPress.org support forum](https://wordpress.org/support/plugin/wp-rollback).
34
-
35
- WP Rollback was created to be as intuitive to the natural WordPress experience as possible. There are is no dedicated setting page or option panels. We believe that once you activate WP Rollback, you'll quickly discover exactly how it works without question.
36
-
37
- **BUT!!**
38
-
39
- We do have documentation on the plugin [Github Wiki](https://github.com/WordImpress/WP-Rollback/wiki).
40
-
41
- == Installation ==
42
-
43
- = Minimum Requirements =
44
-
45
- * WordPress 3.8 or greater
46
- * PHP version 5.3 or greater
47
- * MySQL version 5.0 or greater
48
-
49
- = Automatic installation =
50
-
51
- Automatic installation is the easiest option as WordPress handles the file transfers itself and you don't need to leave your web browser. To do an automatic install of WP Rollback, log in to your WordPress dashboard, navigate to the Plugins menu and click Add New.
52
-
53
- In the search field type "WP Rollback" and click Search Plugins. Once you have found the plugin you can view details about it such as the the point release, rating and description. Most importantly of course, you can install it by simply clicking "Install Now".
54
-
55
- = Manual installation =
56
-
57
- The manual installation method involves downloading our donation plugin and uploading it to your server via your favorite FTP application. The WordPress codex contains [instructions on how to do this here](http://codex.wordpress.org/Managing_Plugins#Manual_Plugin_Installation).
58
-
59
- = Updating =
60
-
61
- Automatic updates should work like a charm; as always though, ensure you backup your site just in case.
62
-
63
- == Frequently Asked Questions ==
64
-
65
- = Is this plugin safe to use? =
66
- Short answer = Yes. Longer answer = It depends on how you use it.
67
-
68
- WP Rollback is completely safe because all it does is take publicly available versions of the plugins you already have on your site and install the version that you designate. There is no other kinds of trickery or fancy offsite calls or anything. BUT!!!
69
-
70
- Safety largely depends on you. The WordPress website admin. We absolutely do NOT recommend rolling back any plugins or themes on a live site. Test the rollback locally first, have backups, use all the best practice tools available to you. This is intended to make rolling back easier, that's all.
71
-
72
- = Why isn't there a rollback button next to X plugin or theme? =
73
-
74
- WP Rollback only works with plugins or themes installed from the WordPress Repository. If you don't see the rollback link, then most likely that plugin or theme is not found on WordPress.org. This plugin does not support plugins from Github, ThemeForest, or other sources other than the WordPress.org Repo.
75
-
76
- = I rolled my [insert plugin name] back to version X.X and now my site is broken. This is your fault. =
77
-
78
- Nope. We warned you in **bold** print several times in many places. And our plugin delivered exactly what it said it would do. May the gods of the Internet pity your broken site's soul.
79
-
80
- = Where is the complete documentation located? =
81
-
82
- The documentation for this plugin is located on our [Github Wiki](https://github.com/WordImpress/WP-Rollback/wiki). This is where we make regular updates.
83
-
84
- = Can this plugin be translated? =
85
-
86
- Yes! All strings are internationalized and ready to be translated. Simply use the languages/wp-rollback.pot file and your favorite translation tool. Once finished, please reach out to us on the WordPress.org forums or better yet, submit a pull request on the [Github Repo](https://github.com/WordImpress/WP-Rollback/).
87
-
88
- = Did this plugin with WordCamp Orange County's Plugin-Palooza? =
89
-
90
- Heck yes it did! The WordImpress team took home the gold.
91
-
92
- == Screenshots ==
93
-
94
- 1. The Rollback link on the Plugins page.
95
-
96
- 2. The Rollback Versions page for a plugin.
97
-
98
- 3. The Update plugin screen.
99
-
100
- 4. The Rollback button on the Theme Modal popup.
101
-
102
- 5. The Rollback Versions page for a theme.
103
-
104
- 6. The Rollback modal confirmation popup.
105
-
106
- 7. The Update theme screen.
107
-
108
- == Upgrade Notice ==
109
-
110
- This is the first version of this plugin. It is a tool for your convenience. Rollback at your own risk!
111
-
112
- == Changelog ==
113
-
114
- = 1.3 =
115
- * Tested compatibility with WordPress 4.4 and verified as working; bumped up compatibility
116
- * Fix: Trying to get property of non-object warning - https://github.com/WordImpress/WP-Rollback/issues/20
117
- * Improvement: Better version sorting now using usort & version_compare - https://github.com/WordImpress/WP-Rollback/issues/16
118
-
119
- = 1.2.4 =
120
- * New: Portuguese translations added
121
- * Fix: Limit HTTP requests to Plugin page only #17 @see: https://wordpress.org/support/topic/great-plugin-but-small-issue?replies=5 and https://wordpress.org/support/topic/great-plugin-but-small-issue?replies=1#post-7234287
122
-
123
- = 1.2.3 =
124
- * Fixed: XSS hardening. Thanks @secupress
125
- * Fixed: CSRF patch regarding missing nonces. Thanks @secupress
126
- * Improvement: escape all of the things.
127
-
128
- = 1.2.2 =
129
- * New: Russian translations from @Flector - thanks!
130
- * Fix: Replaced use of wp_json_encode to support older WordPress versions @see https://wordpress.org/support/topic/wordpress-requirement-issue-with-wp_json_encode
131
-
132
- = 1.2.1 =
133
- * Fix: Rollback link appears on non wp.org plugins https://github.com/WordImpress/WP-Rollback/issues/14 - thanks @scottopolis
134
- * Removed unnecessary WP_ROLLBACK_VERSION constant
135
-
136
- = 1.2 =
137
- * New: Swedish translation files - Thanks @WPDailyThemes
138
-
139
- = 1.1 =
140
- * Fixed "Cancel" button which was falsely submitting the form
141
-
142
- = 1.0 =
143
-
144
- * Initial plugin release. Yippee!
145
- * Adds "Rollback" link to all plugins from the WordPress repo on the plugin screen.
146
- * Adds "Rollback" link to all themes from the WordPress repo inside the modal details screen.
147
- * The "Rollback" page allows you to choose which version you want to rollback to.
 
 
 
 
 
1
+ === WP Rollback ===
2
+ Contributors: wordimpress, dlocc, drrobotnik, webdevmattcrom
3
+ Tags: rollback, revert, downgrade, version, plugins, themes, version, versions, backup, backups, revision, revisions
4
+ Requires at least: 4.0
5
+ Donate Link: https://wordimpress.com
6
+ Tested up to: 4.6.1
7
+ Stable tag: 1.4
8
+ License: GPLv3
9
+ License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
+
11
+ Rollback (or forward) any WordPress.org plugin or theme like a boss.
12
+
13
+ == Description ==
14
+
15
+ Quickly and easily rollback any theme or plugin from WordPress.org to any previous (or newer) version without any of the manual fuss. Works just like the plugin updater, except you're rolling back (or forward) to a specific version. No need for manually downloading and FTPing the files or learning Subversion. This plugin takes care of the trouble for you.
16
+
17
+ = Rollback WordPress.org Plugins and Themes =
18
+
19
+ While it's considered best practice to always keep your WordPress plugins and themes updated, we understand there are times you may need to quickly revert to a previous version. This plugin makes that process as easy as a few mouse clicks. Simply select the version of the plugin or theme that you'd like to rollback to, confirm, and in a few moments you'll be using the version requested. No more fumbling to find the version, downloading, unzipping, FTPing, learning Subversion or hair pulling.
20
+
21
+ = Muy Importante (Very Important): Always Test and Backup =
22
+
23
+ **Important Disclaimer:** This plugin is not intended to be used without first taking the proper precautions to ensure zero data loss or site downtime. Always be sure you have first tested the rollback on a staging or development site prior to using WP Rollback on a live site.
24
+
25
+ We provide no (zero) assurances, guarantees, or warranties that the plugin, theme, or WordPress version you are downgrading to will work as you expect. Use this plugin at your own risk.
26
+
27
+ = Translation Ready =
28
+
29
+ Do you speak another language? Want to contribute in a meaninful way to WP Rollback? There's no better way than to help us translate the plugin. This plugin is translation ready. Simply use the wp-rollback.pot file and your favorite translation tool. Once finished, please reach out to us on the WordPress.org forums or better yet, submit a pull request on the [Github Repo](https://github.com/WordImpress/WP-Rollback/).
30
+
31
+ = Support and Documentation =
32
+
33
+ We answer all support requests [on the WordPress.org support forum](https://wordpress.org/support/plugin/wp-rollback).
34
+
35
+ WP Rollback was created to be as intuitive to the natural WordPress experience as possible. There are is no dedicated setting page or option panels. We believe that once you activate WP Rollback, you'll quickly discover exactly how it works without question.
36
+
37
+ **BUT!!**
38
+
39
+ We do have documentation on the plugin [Github Wiki](https://github.com/WordImpress/WP-Rollback/wiki).
40
+
41
+ == Installation ==
42
+
43
+ = Minimum Requirements =
44
+
45
+ * WordPress 3.8 or greater
46
+ * PHP version 5.3 or greater
47
+ * MySQL version 5.0 or greater
48
+
49
+ = Automatic installation =
50
+
51
+ Automatic installation is the easiest option as WordPress handles the file transfers itself and you don't need to leave your web browser. To do an automatic install of WP Rollback, log in to your WordPress dashboard, navigate to the Plugins menu and click Add New.
52
+
53
+ In the search field type "WP Rollback" and click Search Plugins. Once you have found the plugin you can view details about it such as the the point release, rating and description. Most importantly of course, you can install it by simply clicking "Install Now".
54
+
55
+ = Manual installation =
56
+
57
+ The manual installation method involves downloading our donation plugin and uploading it to your server via your favorite FTP application. The WordPress codex contains [instructions on how to do this here](http://codex.wordpress.org/Managing_Plugins#Manual_Plugin_Installation).
58
+
59
+ = Updating =
60
+
61
+ Automatic updates should work like a charm; as always though, ensure you backup your site just in case.
62
+
63
+ == Frequently Asked Questions ==
64
+
65
+ = Is this plugin safe to use? =
66
+ Short answer = Yes. Longer answer = It depends on how you use it.
67
+
68
+ WP Rollback is completely safe because all it does is take publicly available versions of the plugins you already have on your site and install the version that you designate. There is no other kinds of trickery or fancy offsite calls or anything. BUT!!!
69
+
70
+ Safety largely depends on you. The WordPress website admin. We absolutely do NOT recommend rolling back any plugins or themes on a live site. Test the rollback locally first, have backups, use all the best practice tools available to you. This is intended to make rolling back easier, that's all.
71
+
72
+ = Why isn't there a rollback button next to X plugin or theme? =
73
+
74
+ WP Rollback only works with plugins or themes installed from the WordPress Repository. If you don't see the rollback link, then most likely that plugin or theme is not found on WordPress.org. This plugin does not support plugins from Github, ThemeForest, or other sources other than the WordPress.org Repo.
75
+
76
+ = I rolled my [insert plugin name] back to version X.X and now my site is broken. This is your fault. =
77
+
78
+ Nope. We warned you in **bold** print several times in many places. And our plugin delivered exactly what it said it would do. May the gods of the Internet pity your broken site's soul.
79
+
80
+ = Where is the complete documentation located? =
81
+
82
+ The documentation for this plugin is located on our [Github Wiki](https://github.com/WordImpress/WP-Rollback/wiki). This is where we make regular updates.
83
+
84
+ = Can this plugin be translated? =
85
+
86
+ Yes! All strings are internationalized and ready to be translated. Simply use the languages/wp-rollback.pot file and your favorite translation tool. Once finished, please reach out to us on the WordPress.org forums or better yet, submit a pull request on the [Github Repo](https://github.com/WordImpress/WP-Rollback/).
87
+
88
+ = Did this plugin with WordCamp Orange County's Plugin-Palooza? =
89
+
90
+ Heck yes it did! The WordImpress team took home the gold.
91
+
92
+ == Screenshots ==
93
+
94
+ 1. The Rollback link on the Plugins page.
95
+
96
+ 2. The Rollback Versions page for a plugin.
97
+
98
+ 3. The Update plugin screen.
99
+
100
+ 4. The Rollback button on the Theme Modal popup.
101
+
102
+ 5. The Rollback Versions page for a theme.
103
+
104
+ 6. The Rollback modal confirmation popup.
105
+
106
+ 7. The Update theme screen.
107
+
108
+ == Upgrade Notice ==
109
+
110
+ This is the first version of this plugin. It is a tool for your convenience. Rollback at your own risk!
111
+
112
+ == Changelog ==
113
+
114
+ = 1.4 =
115
+ * New: Updated plugin's text domain to the plugin's slug of 'wp-rollback' to support WordPress' GlotPress translations - https://github.com/WordImpress/WP-Rollback/issues/28
116
+ * New: Gulp automated POT file generation and text domain checker - https://github.com/WordImpress/WP-Rollback/issues/28
117
+ * Fix: Check the WP install's themes transient is present, if not fetch it to see if a theme can be rolled back. Allows rollbacks for new WP installs or in a case where the transient is not set properly - https://github.com/WordImpress/WP-Rollback/issues/27
118
+
119
+ = 1.3 =
120
+ * Tested compatibility with WordPress 4.4 and verified as working; bumped up compatibility
121
+ * Fix: Trying to get property of non-object warning - https://github.com/WordImpress/WP-Rollback/issues/20
122
+ * Improvement: Better version sorting now using usort & version_compare - https://github.com/WordImpress/WP-Rollback/issues/16
123
+
124
+ = 1.2.4 =
125
+ * New: Portuguese translations added
126
+ * Fix: Limit HTTP requests to Plugin page only #17 @see: https://wordpress.org/support/topic/great-plugin-but-small-issue?replies=5 and https://wordpress.org/support/topic/great-plugin-but-small-issue?replies=1#post-7234287
127
+
128
+ = 1.2.3 =
129
+ * Fixed: XSS hardening. Thanks @secupress
130
+ * Fixed: CSRF patch regarding missing nonces. Thanks @secupress
131
+ * Improvement: escape all of the things.
132
+
133
+ = 1.2.2 =
134
+ * New: Russian translations from @Flector - thanks!
135
+ * Fix: Replaced use of wp_json_encode to support older WordPress versions @see https://wordpress.org/support/topic/wordpress-requirement-issue-with-wp_json_encode
136
+
137
+ = 1.2.1 =
138
+ * Fix: Rollback link appears on non wp.org plugins https://github.com/WordImpress/WP-Rollback/issues/14 - thanks @scottopolis
139
+ * Removed unnecessary WP_ROLLBACK_VERSION constant
140
+
141
+ = 1.2 =
142
+ * New: Swedish translation files - Thanks @WPDailyThemes
143
+
144
+ = 1.1 =
145
+ * Fixed "Cancel" button which was falsely submitting the form
146
+
147
+ = 1.0 =
148
+
149
+ * Initial plugin release. Yippee!
150
+ * Adds "Rollback" link to all plugins from the WordPress repo on the plugin screen.
151
+ * Adds "Rollback" link to all themes from the WordPress repo inside the modal details screen.
152
+ * The "Rollback" page allows you to choose which version you want to rollback to.
wp-rollback.php CHANGED
@@ -1,719 +1,768 @@
1
- <?php
2
- /**
3
- * Plugin Name: WP Rollback
4
- * Plugin URI: http://wordimpress.com
5
- * Description: Rollback (or forward) any WordPress.org plugin or theme like a boss.
6
- * Author: WordImpress
7
- * Author URI: http://wordimpress.com
8
- * Version: 1.3
9
- * Text Domain: wpr
10
- * Domain Path: languages
11
- *
12
- * WP Rollback is free software: you can redistribute it and/or modify
13
- * it under the terms of the GNU General Public License as published by
14
- * the Free Software Foundation, either version 2 of the License, or
15
- * any later version.
16
- *
17
- * WP Rollback is distributed in the hope that it will be useful,
18
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
19
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
- * GNU General Public License for more details.
21
- *
22
- * You should have received a copy of the GNU General Public License
23
- * along with WP Rollback. If not, see <http://www.gnu.org/licenses/>.
24
- *
25
- */
26
-
27
- // Exit if accessed directly
28
- if ( ! defined( 'ABSPATH' ) ) {
29
- exit;
30
- }
31
-
32
- if ( ! class_exists( 'WP Rollback' ) ) : /**
33
- * Main WP Rollback Class
34
- *
35
- * @since 1.0
36
- */ {
37
- final class WP_Rollback {
38
- /** Singleton *************************************************************/
39
-
40
- /**
41
- * @var WP_Rollback The one and only
42
- * @since 1.0
43
- */
44
- private static $instance;
45
-
46
- /**
47
- * WP_Rollback Settings Object
48
- *
49
- * @var object
50
- * @since 1.0
51
- */
52
- public $wpr_settings;
53
-
54
- public $plugins_repo = 'http://plugins.svn.wordpress.org';
55
-
56
- public $themes_repo = 'http://themes.svn.wordpress.org';
57
-
58
- public $plugin_file;
59
-
60
- public $plugin_slug;
61
-
62
- public $versions;
63
-
64
- public $current_version;
65
-
66
-
67
- /**
68
- * Main WP_Rollback Instance
69
- *
70
- * Insures that only one instance of WP Rollback exists in memory at any one
71
- * time. Also prevents needing to define globals all over the place.
72
- *
73
- * @since 1.0
74
- * @static
75
- * @staticvar array $instance
76
- * @uses WP_Rollback::setup_constants() Setup the constants needed
77
- * @uses WP_Rollback::includes() Include the required files
78
- * @uses WP_Rollback::load_textdomain() load the language files
79
- * @see WP_Rollback()
80
- * @return WP_Rollback
81
- */
82
- public static function instance() {
83
- if ( ! isset( self::$instance ) && ! ( self::$instance instanceof WP_Rollback ) && is_admin() ) {
84
- self::$instance = new WP_Rollback;
85
- self::$instance->setup_constants();
86
-
87
- //Only setup plugin rollback on specific page
88
- if ( isset( $_GET['plugin_file'] ) && $_GET['page'] == 'wp-rollback' ) {
89
- self::$instance->setup_plugin_vars();
90
- }
91
-
92
- //i18n
93
- add_action( 'plugins_loaded', array( self::$instance, 'load_textdomain' ) );
94
- //Admin
95
- add_action( 'admin_enqueue_scripts', array( self::$instance, 'scripts' ) );
96
- add_action( 'admin_menu', array( self::$instance, 'admin_menu' ), 20 );
97
- add_action( 'pre_current_active_plugins', array(
98
- self::$instance,
99
- 'pre_current_active_plugins'
100
- ), 20, 1 );
101
- add_action( 'wp_ajax_is_wordpress_theme', array( self::$instance, 'is_wordpress_theme' ) );
102
- add_action( 'set_site_transient_update_themes', array( self::$instance, 'wpr_theme_updates_list' ) );
103
-
104
- add_filter( 'wp_prepare_themes_for_js', array( self::$instance, 'wpr_prepare_themes_js' ) );
105
- add_filter( 'plugin_action_links', array( self::$instance, 'plugin_action_links' ), 20, 4 );
106
-
107
- self::$instance->includes();
108
-
109
- }
110
-
111
- return self::$instance;
112
- }
113
-
114
- /**
115
- * Throw error on object clone
116
- *
117
- * The whole idea of the singleton design pattern is that there is a single
118
- * object therefore, we don't want the object to be cloned.
119
- *
120
- * @since 1.0
121
- * @access protected
122
- * @return void
123
- */
124
- public function __clone() {
125
- // Cloning instances of the class is forbidden
126
- _doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'wpr' ), '1.0' );
127
- }
128
-
129
- /**
130
- * Disable unserializing of the class
131
- *
132
- * @since 1.0
133
- * @access protected
134
- * @return void
135
- */
136
- public function __wakeup() {
137
- // Unserializing instances of the class is forbidden
138
- _doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'wpr' ), '1.0' );
139
- }
140
-
141
- /**
142
- * Setup plugin constants
143
- *
144
- * @access private
145
- * @since 1.0
146
- * @return void
147
- */
148
- private function setup_constants() {
149
-
150
- // Plugin Folder Path
151
- if ( ! defined( 'WP_ROLLBACK_PLUGIN_DIR' ) ) {
152
- define( 'WP_ROLLBACK_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
153
- }
154
-
155
- // Plugin Folder URL
156
- if ( ! defined( 'WP_ROLLBACK_PLUGIN_URL' ) ) {
157
- define( 'WP_ROLLBACK_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
158
- }
159
-
160
- // Plugin Root File
161
- if ( ! defined( 'WP_ROLLBACK_PLUGIN_FILE' ) ) {
162
- define( 'WP_ROLLBACK_PLUGIN_FILE', __FILE__ );
163
- }
164
-
165
- }
166
-
167
- /**
168
- * Setup Variables
169
- *
170
- * @access private
171
- * @description:
172
- */
173
- private function setup_plugin_vars() {
174
- $this->set_plugin_slug();
175
-
176
- $svn_tags = $this->get_svn_tags( 'plugin', $this->plugin_slug );
177
- $this->set_svn_versions_data( $svn_tags );
178
- }
179
-
180
- /**
181
- * Include required files
182
- *
183
- * @access private
184
- * @since 1.0
185
- * @return void
186
- */
187
- private function includes() {
188
-
189
- }
190
-
191
- /**
192
- * Enqueue Admin Scripts
193
- *
194
- * @access private
195
- * @since 1.0
196
- *
197
- * @param $hook
198
- *
199
- * @return void
200
- *
201
- */
202
- public function scripts( $hook ) {
203
-
204
- if ( $hook === 'themes.php' ) {
205
- wp_enqueue_script( 'wp_rollback_themes_script', plugin_dir_url( __FILE__ ) . 'assets/js/themes-wp-rollback.js', array( 'jquery' ), false, true );
206
- //Localize for i18n
207
- wp_localize_script( 'wp_rollback_themes_script', 'wpr_vars', array(
208
- 'ajaxurl' => admin_url(),
209
- 'ajax_loader' => admin_url( 'images/spinner.gif' ),
210
- 'nonce' => wp_create_nonce( 'wpr_rollback_nonce' ),
211
- 'text_rollback_label' => __( 'Rollback', 'wpr' ),
212
- 'text_not_rollbackable' => __( 'No Rollback Available: This is a non-WordPress.org theme.', 'wpr' ),
213
- 'text_loading_rollback' => __( 'Loading...', 'wpr' ),
214
- ) );
215
- }
216
-
217
- if ( $hook !== 'dashboard_page_wp-rollback' ) {
218
- return;
219
- }
220
-
221
- $suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
222
-
223
- wp_enqueue_style( 'wp_rollback_css', plugin_dir_url( __FILE__ ) . 'assets/css/wp-rollback.css' );
224
- wp_enqueue_style( 'wp_rollback_modal_css', plugin_dir_url( __FILE__ ) . 'assets/css/magnific-popup.css' );
225
- wp_enqueue_script( 'wp_rollback_modal', plugin_dir_url( __FILE__ ) . 'assets/js/jquery.magnific-popup' . $suffix . '.js', array( 'jquery' ) );
226
- wp_enqueue_script( 'wp_rollback_script', plugin_dir_url( __FILE__ ) . 'assets/js/wp-rollback.js', array( 'jquery' ) );
227
- wp_enqueue_script( 'updates' );
228
-
229
- //Localize for i18n
230
- wp_localize_script( 'wp_rollback_script', 'wpr_vars', array(
231
- 'ajaxurl' => admin_url(),
232
- 'version_missing' => __( 'Please select a version number to perform a rollback.', 'wpr' ),
233
- ) );
234
-
235
-
236
- }
237
-
238
- /**
239
- * Loads the plugin language files
240
- *
241
- * @access public
242
- * @since 1.0
243
- * @return void
244
- */
245
- public function load_textdomain() {
246
-
247
- // Set filter for plugin's languages directory
248
- $wpr_lang_dir = dirname( plugin_basename( WP_ROLLBACK_PLUGIN_FILE ) ) . '/languages/';
249
- $wpr_lang_dir = apply_filters( 'wpr_languages_directory', $wpr_lang_dir );
250
-
251
- // Traditional WordPress plugin locale filter
252
- $locale = apply_filters( 'plugin_locale', get_locale(), 'wpr' );
253
- $mofile = sprintf( '%1$s-%2$s.mo', 'wpr', $locale );
254
-
255
- // Setup paths to current locale file
256
- $mofile_local = $wpr_lang_dir . $mofile;
257
- $mofile_global = WP_LANG_DIR . '/wp-rollback/' . $mofile;
258
-
259
- if ( file_exists( $mofile_global ) ) {
260
- // Look in global /wp-content/languages/wpr folder
261
- load_textdomain( 'wpr', $mofile_global );
262
- } elseif ( file_exists( $mofile_local ) ) {
263
- // Look in local /wp-content/plugins/wpr/languages/ folder
264
- load_textdomain( 'wpr', $mofile_local );
265
- } else {
266
- // Load the default language files
267
- load_plugin_textdomain( 'wpr', false, $wpr_lang_dir );
268
- }
269
- }
270
-
271
- /**
272
- * HTML
273
- *
274
- * @description: FILL ME IN
275
- *
276
- */
277
- public function html() {
278
-
279
- //Permissions check
280
- if ( ! current_user_can( 'update_plugins' ) ) {
281
- wp_die( __( 'You do not have sufficient permissions to perform rollbacks for this site.', 'wpr' ) );
282
- }
283
-
284
- //Get the necessary class
285
- include_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );
286
-
287
- $defaults = apply_filters( 'wpr_rollback_html_args', array(
288
- 'page' => 'wp-rollback',
289
- 'plugin_file' => '',
290
- 'action' => '',
291
- 'plugin_version' => '',
292
- 'plugin' => ''
293
- ) );
294
-
295
-
296
- $args = wp_parse_args( $_GET, $defaults );
297
-
298
- if ( ! empty( $args['plugin_version'] ) ) {
299
- //Plugin: rolling back
300
- check_admin_referer( 'wpr_rollback_nonce' );
301
-
302
- include WP_ROLLBACK_PLUGIN_DIR . '/includes/class-rollback-plugin-upgrader.php';
303
- include WP_ROLLBACK_PLUGIN_DIR . '/includes/rollback-action.php';
304
- } elseif ( ! empty( $args['theme_version'] ) ) {
305
- //Theme: rolling back
306
- check_admin_referer( 'wpr_rollback_nonce' );
307
-
308
- include WP_ROLLBACK_PLUGIN_DIR . '/includes/class-rollback-theme-upgrader.php';
309
- include WP_ROLLBACK_PLUGIN_DIR . '/includes/rollback-action.php';
310
- } else {
311
-
312
- //This is the menu
313
- check_admin_referer( 'wpr_rollback_nonce' );
314
- include WP_ROLLBACK_PLUGIN_DIR . '/includes/rollback-menu.php';
315
-
316
- }
317
-
318
- }
319
-
320
-
321
- /**
322
- * Get Subversion Tags
323
- *
324
- * @description cURLs wp.org repo to get the proper tags
325
- *
326
- * @param $type
327
- * @param $slug
328
- *
329
- * @return null|string
330
- */
331
- private function get_svn_tags( $type, $slug ) {
332
-
333
- $url = $this->plugins_repo . '/' . $this->plugin_slug . '/tags/';
334
-
335
- //is this a theme svn request?
336
- if ( $type == 'theme' ) {
337
- $url = $this->themes_repo . '/' . $slug;
338
- }
339
-
340
- $response = wp_remote_get( $url );
341
-
342
- //Do we have an error?
343
- if ( wp_remote_retrieve_response_code( $response ) !== 200 ) {
344
- return null;
345
- }
346
-
347
- //Nope: Return that bad boy
348
- return wp_remote_retrieve_body( $response );
349
-
350
- }
351
-
352
- /**
353
- * Set SVN Version Data
354
- *
355
- * @description FILL ME IN
356
- *
357
- * @param $html
358
- *
359
- * @return array|bool
360
- */
361
- private function set_svn_versions_data( $html ) {
362
-
363
- if ( ! $html ) {
364
- return false;
365
- }
366
-
367
- $DOM = new DOMDocument;
368
- $DOM->loadHTML( $html );
369
-
370
- $versions = array();
371
-
372
- $items = $DOM->getElementsByTagName( 'a' );
373
-
374
- foreach ( $items as $item ) {
375
- $href = str_replace( '/', '', $item->getAttribute( 'href' ) ); //Remove trailing slash
376
-
377
- if ( strpos( $href, 'http' ) === false && $href !== '..' ) {
378
- $versions[] = $href;
379
- }
380
- }
381
-
382
- $this->versions = array_reverse( $versions );
383
-
384
- return $versions;
385
- }
386
-
387
- /**
388
- * Versions Select
389
- *
390
- * @description Outputs the version radio buttons to select a rollback; types = 'plugin' or 'theme'
391
- *
392
- * @param $type
393
- *
394
- * @return bool|string
395
- */
396
- public function versions_select( $type ) {
397
-
398
- if ( ! $this->versions ) {
399
- return false;
400
- }
401
-
402
- $versions_html = '';
403
-
404
- usort( $this->versions, 'version_compare' );
405
-
406
- $this->versions = array_reverse($this->versions);
407
-
408
- //Loop through versions and output in a radio list
409
- foreach ( $this->versions as $version ) {
410
-
411
- $versions_html .= '<label><input type="radio" value="' . esc_attr( $version ) . '" name="' . $type . '_version">' . $version;
412
-
413
- //Is this the current version?
414
- if ( $version === $this->current_version ) {
415
- $versions_html .= '<span class="current-version">' . __( 'Installed Version', 'wpr' ) . '</span>';
416
- }
417
-
418
- $versions_html .= '</label>';
419
-
420
-
421
- }
422
-
423
- return $versions_html;
424
- }
425
-
426
- /**
427
- * Set Plugin Slug
428
- *
429
- * @return bool
430
- */
431
- private function set_plugin_slug() {
432
-
433
- if ( ! isset( $_GET['plugin_file'] ) ) {
434
- return false;
435
- }
436
-
437
- if ( isset( $_GET['current_version'] ) ) {
438
- $curr_version = explode( ' ', $_GET['current_version'] );
439
- $this->current_version = apply_filters( 'wpr_current_version', $curr_version[0] );
440
- }
441
-
442
- include_once ABSPATH . 'wp-admin/includes/plugin.php';
443
-
444
- $plugin_file = WP_PLUGIN_DIR . '/' . $_GET['plugin_file'];
445
-
446
- if ( ! file_exists( $plugin_file ) ) {
447
- wp_die( 'Plugin you\'re referencing does not exist.' );
448
- }
449
-
450
- $plugin_data = get_plugin_data( $plugin_file, false, false );
451
-
452
- //the plugin slug is the base directory name without the path to the main file
453
- $plugin_slug = explode( '/', plugin_basename( $plugin_file ) );
454
-
455
- $this->plugin_file = apply_filters( 'wpr_plugin_file', $plugin_file );
456
- $this->plugin_slug = apply_filters( 'wpr_plugin_slug', $plugin_slug[0] );
457
-
458
- return $plugin_slug;
459
-
460
- }
461
-
462
- /**
463
- * Admin Menu
464
- *
465
- * @description: Adds a 'hidden' menu item that is activated when the user elects to rollback
466
- */
467
- public function admin_menu() {
468
-
469
- //Only show menu item when necessary (user is interacting with plugin, ie rolling back something)
470
- if ( isset( $_GET['page'] ) && $_GET['page'] == 'wp-rollback' ) {
471
-
472
- //Add it in a native WP way, like WP updates do... (a dashboard page)
473
- add_dashboard_page( __( 'Rollback', 'wpr' ), __( 'Rollback', 'wpr' ), 'update_plugins', 'wp-rollback', array(
474
- self::$instance,
475
- 'html'
476
- ) );
477
-
478
- }
479
-
480
- }
481
-
482
- /**
483
- * Pre-Current Active Plugins
484
- *
485
- * @param $plugins
486
- *
487
- * @return mixed
488
- */
489
- public function pre_current_active_plugins( $plugins ) {
490
- $updated = $plugins;
491
- foreach ( $updated as $key => $value ) {
492
- $updated[ $key ] = $value;
493
- $updated[ $key ]['rollback'] = true;
494
- }
495
-
496
- return $updated;
497
- }
498
-
499
-
500
- /**
501
- * Plugin Action Links
502
- *
503
- * @description Adds a "rollback" link into the plugins listing page w/ appropriate query strings
504
- *
505
- * @param $actions
506
- * @param $plugin_file
507
- * @param $plugin_data
508
- * @param $context
509
- *
510
- * @return array $actions
511
- */
512
- public function plugin_action_links( $actions, $plugin_file, $plugin_data, $context ) {
513
-
514
- //Base rollback URL
515
- $rollback_url = 'index.php?page=wp-rollback&type=plugin&plugin_file=' . $plugin_file;
516
-
517
- //Filter for other devs
518
- $plugin_data = apply_filters( 'wpr_plugin_data', $plugin_data );
519
-
520
- //If plugin is missing package data do not output Rollback option
521
- if ( ! isset( $plugin_data['package'] ) || strpos( $plugin_data['package'], 'https://downloads.wordpress.org' ) === false ) {
522
- return $actions;
523
- }
524
-
525
- //Add in the current version for later reference
526
- if ( isset( $plugin_data['Version'] ) ) {
527
- $rollback_url = add_query_arg( apply_filters( 'wpr_plugin_query_args', array(
528
- 'current_version' => urlencode( $plugin_data['Version'] ),
529
- 'rollback_name' => urlencode( $plugin_data['Name'] ),
530
- '_wpnonce' => wp_create_nonce( 'wpr_rollback_nonce' )
531
- ) ), $rollback_url );
532
- }
533
-
534
- //Final Output
535
- $actions['rollback'] = apply_filters( 'wpr_plugin_markup', '<a href="' . esc_url( $rollback_url ) . '">' . __( 'Rollback', 'wpr' ) . '</a>' );
536
-
537
- return apply_filters( 'wpr_plugin_action_links', $actions );
538
-
539
- }
540
-
541
-
542
- /**
543
- * Is WordPress Theme?
544
- *
545
- * @description Queryies the WordPress.org API via theme's slug to see if this theme is on WordPress
546
- * @return bool
547
- * @TODO Set transient here to speed up future checks?
548
- */
549
- public function is_wordpress_theme() {
550
-
551
- $url = add_query_arg( 'request[slug]', $_POST['theme'], 'https://api.wordpress.org/themes/info/1.1/?action=theme_information' );
552
- $wp_api = wp_remote_get( $url );
553
-
554
- if ( ! is_wp_error( $wp_api ) ) {
555
- if ( isset( $wp_api['body'] ) && strlen( $wp_api['body'] ) > 0 && $wp_api['body'] !== 'false' ) {
556
- echo 'wp';
557
- } else {
558
- echo 'non-wp';
559
- }
560
- } else {
561
- echo 'error';
562
- }
563
-
564
- wp_die(); // this is required to terminate immediately and return a proper response
565
-
566
- }
567
-
568
-
569
- /**
570
- * Plugin Row Meta
571
- *
572
- * @param $plugin_meta
573
- * @param $plugin_file
574
- * @param $plugin_data
575
- * @param $status
576
- *
577
- * @return mixed
578
- */
579
- public function plugin_row_meta( $plugin_meta, $plugin_file, $plugin_data, $status ) {
580
- return $plugin_meta;
581
- }
582
-
583
-
584
- /**
585
- * Updates theme list
586
- *
587
- * @description
588
- *
589
- * @return bool
590
- */
591
- function wpr_theme_updates_list() {
592
-
593
- include( ABSPATH . WPINC . '/version.php' ); // include an unmodified $wp_version
594
-
595
- //Bounce out if improperly called
596
- if ( defined( 'WP_INSTALLING' ) || ! is_admin() ) {
597
- return false;
598
- }
599
-
600
-
601
- $expiration = 12 * HOUR_IN_SECONDS;
602
- $installed_themes = wp_get_themes();
603
-
604
- $last_update = get_site_transient( 'update_themes' );
605
- if ( ! is_object( $last_update ) ) {
606
- set_site_transient( 'rollback_themes', time(), $expiration );
607
- }
608
-
609
- $themes = $checked = $request = array();
610
-
611
- // Put slug of current theme into request.
612
- $request['active'] = get_option( 'stylesheet' );
613
-
614
- foreach ( $installed_themes as $theme ) {
615
- $checked[ $theme->get_stylesheet() ] = $theme->get( 'Version' );
616
-
617
- $themes[ $theme->get_stylesheet() ] = array(
618
- 'Name' => $theme->get( 'Name' ),
619
- 'Title' => $theme->get( 'Name' ),
620
- 'Version' => '0.0.0.0.0.0',
621
- 'Author' => $theme->get( 'Author' ),
622
- 'Author URI' => $theme->get( 'AuthorURI' ),
623
- 'Template' => $theme->get_template(),
624
- 'Stylesheet' => $theme->get_stylesheet(),
625
- );
626
- }
627
-
628
- $request['themes'] = $themes;
629
-
630
- $timeout = 3 + (int) ( count( $themes ) / 10 );
631
-
632
- $options = array(
633
- 'timeout' => $timeout,
634
- 'body' => array(
635
- 'themes' => json_encode( $request ),
636
- ),
637
- 'user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' )
638
- );
639
-
640
- $url = $http_url = 'http://api.wordpress.org/themes/update-check/1.1/';
641
- if ( $ssl = wp_http_supports( array( 'ssl' ) ) ) {
642
- $url = set_url_scheme( $url, 'https' );
643
- }
644
-
645
- $raw_response = wp_remote_post( $url, $options );
646
- if ( $ssl && is_wp_error( $raw_response ) ) {
647
- trigger_error( __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href="https://wordpress.org/support/">support forums</a>.' ) . ' ' . __( '(WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.)' ), headers_sent() || WP_DEBUG ? E_USER_WARNING : E_USER_NOTICE );
648
- $raw_response = wp_remote_post( $http_url, $options );
649
- }
650
-
651
- set_site_transient( 'rollback_themes', time(), $expiration );
652
-
653
- if ( is_wp_error( $raw_response ) || 200 != wp_remote_retrieve_response_code( $raw_response ) ) {
654
- return false;
655
- }
656
-
657
- $new_update = new stdClass;
658
- $new_update->last_checked = time();
659
- $new_update->checked = $checked;
660
-
661
- $response = json_decode( wp_remote_retrieve_body( $raw_response ), true );
662
-
663
- if ( is_array( $response ) ) {
664
- $new_update->response = $response['themes'];
665
- }
666
-
667
- set_site_transient( 'rollback_themes', $new_update );
668
- }
669
-
670
-
671
- /**
672
- * Prepare Themes JS
673
- *
674
- * @param $prepared_themes
675
- *
676
- * @return array
677
- */
678
- function wpr_prepare_themes_js( $prepared_themes ) {
679
- $themes = array();
680
- $wp_themes = get_site_transient( 'rollback_themes' );
681
-
682
- if ( is_object( $wp_themes ) ) {
683
- $rollbacks = $wp_themes->response;
684
- }
685
-
686
-
687
- foreach ( $prepared_themes as $key => $value ) {
688
- $themes[ $key ] = $prepared_themes[ $key ];
689
- $themes[ $key ]['hasRollback'] = isset( $rollbacks[ $key ] );
690
- }
691
-
692
- return $themes;
693
- }
694
-
695
-
696
- }
697
- }
698
-
699
- endif; // End if class_exists check
700
-
701
-
702
- /**
703
- * The main function responsible for returning the one true WP Rollback
704
- * Instance to functions everywhere.
705
- *
706
- * Use this function like you would a global variable, except without needing
707
- * to declare the global.
708
- *
709
- * Example: <?php $wp_rollback = WP_Rollback(); ?>
710
- *
711
- * @since 1.0
712
- * @return object The one true WP Rollback Instance
713
- */
714
- function WP_Rollback() {
715
- return WP_Rollback::instance();
716
- }
717
-
718
- // Get WP Rollback Running
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
719
  WP_Rollback();
1
+ <?php
2
+ /**
3
+ * Plugin Name: WP Rollback
4
+ * Plugin URI: https://wordimpress.com
5
+ * Description: Rollback (or forward) any WordPress.org plugin or theme like a boss.
6
+ * Author: WordImpress
7
+ * Author URI: https://wordimpress.com
8
+ * Version: 1.4
9
+ * Text Domain: wp-rollback
10
+ * Domain Path: /languages
11
+ *
12
+ * WP Rollback is free software: you can redistribute it and/or modify
13
+ * it under the terms of the GNU General Public License as published by
14
+ * the Free Software Foundation, either version 2 of the License, or
15
+ * any later version.
16
+ *
17
+ * WP Rollback is distributed in the hope that it will be useful,
18
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
19
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
+ * GNU General Public License for more details.
21
+ *
22
+ * You should have received a copy of the GNU General Public License
23
+ * along with WP Rollback. If not, see <http://www.gnu.org/licenses/>.
24
+ */
25
+
26
+
27
+ // Exit if accessed directly.
28
+ if ( ! defined( 'ABSPATH' ) ) {
29
+ exit;
30
+ }
31
+
32
+ /**
33
+ * Main WP Rollback Class
34
+ *
35
+ * @since 1.0
36
+ */
37
+ if ( ! class_exists( 'WP Rollback' ) ) : {
38
+ /**
39
+ * Class WP_Rollback
40
+ */
41
+ final class WP_Rollback {
42
+ /** Singleton *************************************************************/
43
+
44
+ /**
45
+ * @var WP_Rollback The one and only
46
+ * @since 1.0
47
+ */
48
+ private static $instance;
49
+
50
+ /**
51
+ * WP_Rollback Settings Object
52
+ *
53
+ * @var object
54
+ * @since 1.0
55
+ */
56
+ public $wpr_settings;
57
+
58
+ /**
59
+ * Plugins repo url.
60
+ *
61
+ * @var string
62
+ */
63
+ public $plugins_repo = 'http://plugins.svn.wordpress.org';
64
+
65
+ /**
66
+ * Themes repo url.
67
+ * @var string
68
+ */
69
+ public $themes_repo = 'http://themes.svn.wordpress.org';
70
+
71
+ /**
72
+ * Plugin file.
73
+ *
74
+ * @var string
75
+ */
76
+ public $plugin_file;
77
+
78
+ /**
79
+ * Plugin slug.
80
+ *
81
+ * @var string
82
+ */
83
+ public $plugin_slug;
84
+
85
+ /**
86
+ * Versions.
87
+ *
88
+ * @var array
89
+ */
90
+ public $versions;
91
+
92
+ /**
93
+ * Current version.
94
+ *
95
+ * @var string
96
+ */
97
+ public $current_version;
98
+
99
+
100
+ /**
101
+ * Main WP_Rollback Instance
102
+ *
103
+ * Insures that only one instance of WP Rollback exists in memory at any one
104
+ * time. Also prevents needing to define globals all over the place.
105
+ *
106
+ * @since 1.0
107
+ * @static
108
+ * @staticvar array $instance
109
+ * @uses WP_Rollback::setup_constants() Setup the constants needed
110
+ * @uses WP_Rollback::includes() Include the required files
111
+ * @uses WP_Rollback::load_textdomain() load the language files
112
+ * @see WP_Rollback()
113
+ * @return WP_Rollback
114
+ */
115
+ public static function instance() {
116
+ if ( ! isset( self::$instance ) && ! ( self::$instance instanceof WP_Rollback ) && is_admin() ) {
117
+ self::$instance = new WP_Rollback;
118
+ self::$instance->setup_constants();
119
+
120
+ //Only setup plugin rollback on specific page
121
+ if ( isset( $_GET['plugin_file'] ) && $_GET['page'] == 'wp-rollback' ) {
122
+ self::$instance->setup_plugin_vars();
123
+ }
124
+
125
+ //i18n
126
+ add_action( 'plugins_loaded', array( self::$instance, 'load_textdomain' ) );
127
+ //Admin
128
+ add_action( 'admin_enqueue_scripts', array( self::$instance, 'scripts' ) );
129
+ add_action( 'admin_menu', array( self::$instance, 'admin_menu' ), 20 );
130
+ add_action( 'pre_current_active_plugins', array(
131
+ self::$instance,
132
+ 'pre_current_active_plugins'
133
+ ), 20, 1 );
134
+ add_action( 'wp_ajax_is_wordpress_theme', array( self::$instance, 'is_wordpress_theme' ) );
135
+ add_action( 'set_site_transient_update_themes', array( self::$instance, 'wpr_theme_updates_list' ) );
136
+
137
+ add_filter( 'wp_prepare_themes_for_js', array( self::$instance, 'wpr_prepare_themes_js' ) );
138
+ add_filter( 'plugin_action_links', array( self::$instance, 'plugin_action_links' ), 20, 4 );
139
+
140
+ self::$instance->includes();
141
+
142
+ }
143
+
144
+ return self::$instance;
145
+ }
146
+
147
+ /**
148
+ * Throw error on object clone
149
+ *
150
+ * The whole idea of the singleton design pattern is that there is a single
151
+ * object therefore, we don't want the object to be cloned.
152
+ *
153
+ * @since 1.0
154
+ * @access protected
155
+ * @return void
156
+ */
157
+ public function __clone() {
158
+ // Cloning instances of the class is forbidden
159
+ _doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'wp-rollback' ), '1.0' );
160
+ }
161
+
162
+ /**
163
+ * Disable unserializing of the class
164
+ *
165
+ * @since 1.0
166
+ * @access protected
167
+ * @return void
168
+ */
169
+ public function __wakeup() {
170
+ // Unserializing instances of the class is forbidden
171
+ _doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'wp-rollback' ), '1.0' );
172
+ }
173
+
174
+ /**
175
+ * Setup plugin constants
176
+ *
177
+ * @access private
178
+ * @since 1.0
179
+ * @return void
180
+ */
181
+ private function setup_constants() {
182
+
183
+ // Plugin Folder Path
184
+ if ( ! defined( 'WP_ROLLBACK_PLUGIN_DIR' ) ) {
185
+ define( 'WP_ROLLBACK_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
186
+ }
187
+
188
+ // Plugin Folder URL
189
+ if ( ! defined( 'WP_ROLLBACK_PLUGIN_URL' ) ) {
190
+ define( 'WP_ROLLBACK_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
191
+ }
192
+
193
+ // Plugin Root File
194
+ if ( ! defined( 'WP_ROLLBACK_PLUGIN_FILE' ) ) {
195
+ define( 'WP_ROLLBACK_PLUGIN_FILE', __FILE__ );
196
+ }
197
+
198
+ }
199
+
200
+ /**
201
+ * Setup Variables
202
+ *
203
+ * @access private
204
+ * @description:
205
+ */
206
+ private function setup_plugin_vars() {
207
+ $this->set_plugin_slug();
208
+
209
+ $svn_tags = $this->get_svn_tags( 'plugin', $this->plugin_slug );
210
+ $this->set_svn_versions_data( $svn_tags );
211
+ }
212
+
213
+ /**
214
+ * Include required files
215
+ *
216
+ * @access private
217
+ * @since 1.0
218
+ * @return void
219
+ */
220
+ private function includes() {
221
+
222
+ }
223
+
224
+ /**
225
+ * Enqueue Admin Scripts
226
+ *
227
+ * @access private
228
+ * @since 1.0
229
+ *
230
+ * @param $hook
231
+ *
232
+ * @return void
233
+ *
234
+ */
235
+ public function scripts( $hook ) {
236
+
237
+ if ( $hook === 'themes.php' ) {
238
+ wp_enqueue_script( 'wp_rollback_themes_script', plugin_dir_url( __FILE__ ) . 'assets/js/themes-wp-rollback.js', array( 'jquery' ), false, true );
239
+ //Localize for i18n
240
+ wp_localize_script( 'wp_rollback_themes_script', 'wpr_vars', array(
241
+ 'ajaxurl' => admin_url(),
242
+ 'ajax_loader' => admin_url( 'images/spinner.gif' ),
243
+ 'nonce' => wp_create_nonce( 'wpr_rollback_nonce' ),
244
+ 'text_rollback_label' => __( 'Rollback', 'wp-rollback' ),
245
+ 'text_not_rollbackable' => __( 'No Rollback Available: This is a non-WordPress.org theme.', 'wp-rollback' ),
246
+ 'text_loading_rollback' => __( 'Loading...', 'wp-rollback' ),
247
+ ) );
248
+ }
249
+
250
+ if ( $hook !== 'dashboard_page_wp-rollback' ) {
251
+ return;
252
+ }
253
+
254
+ $suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
255
+
256
+ //CSS
257
+ wp_register_style( 'wp_rollback_css', plugin_dir_url( __FILE__ ) . 'assets/css/wp-rollback.css' );
258
+ wp_enqueue_style( 'wp_rollback_css' );
259
+
260
+ wp_register_style( 'wp_rollback_modal_css', plugin_dir_url( __FILE__ ) . 'assets/css/magnific-popup.css' );
261
+ wp_enqueue_style( 'wp_rollback_modal_css' );
262
+
263
+ //JS
264
+ wp_register_script( 'wp_rollback_modal', plugin_dir_url( __FILE__ ) . 'assets/js/jquery.magnific-popup' . $suffix . '.js', array( 'jquery' ) );
265
+ wp_enqueue_script( 'wp_rollback_modal' );
266
+
267
+ wp_register_script( 'wp_rollback_script', plugin_dir_url( __FILE__ ) . 'assets/js/wp-rollback.js', array( 'jquery' ) );
268
+ wp_enqueue_script( 'wp_rollback_script' );
269
+
270
+ wp_enqueue_script( 'updates' );
271
+
272
+ //Localize for i18n.
273
+ wp_localize_script( 'wp_rollback_script', 'wpr_vars', array(
274
+ 'ajaxurl' => admin_url(),
275
+ 'version_missing' => __( 'Please select a version number to perform a rollback.', 'wp-rollback' ),
276
+ ) );
277
+
278
+
279
+ }
280
+
281
+ /**
282
+ * Loads the plugin language files
283
+ *
284
+ * @access public
285
+ * @since 1.0
286
+ * @return void
287
+ */
288
+ public function load_textdomain() {
289
+
290
+ // Set filter for plugin's languages directory
291
+ $wpr_lang_dir = dirname( plugin_basename( WP_ROLLBACK_PLUGIN_FILE ) ) . '/languages/';
292
+ $wpr_lang_dir = apply_filters( 'wpr_languages_directory', $wpr_lang_dir );
293
+
294
+ // Traditional WordPress plugin locale filter
295
+ $locale = apply_filters( 'plugin_locale', get_locale(), 'wp-rollback' );
296
+ $mofile = sprintf( '%1$s-%2$s.mo', 'wp-rollback', $locale );
297
+
298
+ // Setup paths to current locale file
299
+ $mofile_local = $wpr_lang_dir . $mofile;
300
+ $mofile_global = WP_LANG_DIR . '/wp-rollback/' . $mofile;
301
+
302
+ if ( file_exists( $mofile_global ) ) {
303
+ // Look in global /wp-content/languages/wpr folder
304
+ load_textdomain( 'wp-rollback', $mofile_global );
305
+ } elseif ( file_exists( $mofile_local ) ) {
306
+ // Look in local /wp-content/plugins/wpr/languages/ folder
307
+ load_textdomain( 'wp-rollback', $mofile_local );
308
+ } else {
309
+ // Load the default language files
310
+ load_plugin_textdomain( 'wp-rollback', false, $wpr_lang_dir );
311
+ }
312
+ }
313
+
314
+ /**
315
+ * HTML
316
+ */
317
+ public function html() {
318
+
319
+ //Permissions check
320
+ if ( ! current_user_can( 'update_plugins' ) ) {
321
+ wp_die( __( 'You do not have sufficient permissions to perform rollbacks for this site.', 'wp-rollback' ) );
322
+ }
323
+
324
+ //Get the necessary class
325
+ include_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );
326
+
327
+ $defaults = apply_filters( 'wpr_rollback_html_args', array(
328
+ 'page' => 'wp-rollback',
329
+ 'plugin_file' => '',
330
+ 'action' => '',
331
+ 'plugin_version' => '',
332
+ 'plugin' => ''
333
+ ) );
334
+
335
+
336
+ $args = wp_parse_args( $_GET, $defaults );
337
+
338
+ if ( ! empty( $args['plugin_version'] ) ) {
339
+ //Plugin: rolling back.
340
+ check_admin_referer( 'wpr_rollback_nonce' );
341
+ include WP_ROLLBACK_PLUGIN_DIR . '/includes/class-rollback-plugin-upgrader.php';
342
+ include WP_ROLLBACK_PLUGIN_DIR . '/includes/rollback-action.php';
343
+ } elseif ( ! empty( $args['theme_version'] ) ) {
344
+ //Theme: rolling back.
345
+ check_admin_referer( 'wpr_rollback_nonce' );
346
+ include WP_ROLLBACK_PLUGIN_DIR . '/includes/class-rollback-theme-upgrader.php';
347
+ include WP_ROLLBACK_PLUGIN_DIR . '/includes/rollback-action.php';
348
+ } else {
349
+ //This is the menu.
350
+ check_admin_referer( 'wpr_rollback_nonce' );
351
+ include WP_ROLLBACK_PLUGIN_DIR . '/includes/rollback-menu.php';
352
+
353
+ }
354
+
355
+ }
356
+
357
+
358
+ /**
359
+ * Get Subversion Tags
360
+ *
361
+ * @description cURLs wp.org repo to get the proper tags
362
+ *
363
+ * @param $type
364
+ * @param $slug
365
+ *
366
+ * @return null|string
367
+ */
368
+ private function get_svn_tags( $type, $slug ) {
369
+
370
+ $url = $this->plugins_repo . '/' . $this->plugin_slug . '/tags/';
371
+
372
+ //is this a theme svn request?
373
+ if ( $type == 'theme' ) {
374
+ $url = $this->themes_repo . '/' . $slug;
375
+ }
376
+
377
+ $response = wp_remote_get( $url );
378
+
379
+ //Do we have an error?
380
+ if ( wp_remote_retrieve_response_code( $response ) !== 200 ) {
381
+ return null;
382
+ }
383
+
384
+ //Nope: Return that bad boy
385
+ return wp_remote_retrieve_body( $response );
386
+
387
+ }
388
+
389
+ /**
390
+ * Set SVN Version Data
391
+ *
392
+ * @description FILL ME IN
393
+ *
394
+ * @param $html
395
+ *
396
+ * @return array|bool
397
+ */
398
+ private function set_svn_versions_data( $html ) {
399
+
400
+ if ( ! $html ) {
401
+ return false;
402
+ }
403
+
404
+ $DOM = new DOMDocument;
405
+ $DOM->loadHTML( $html );
406
+
407
+ $versions = array();
408
+
409
+ $items = $DOM->getElementsByTagName( 'a' );
410
+
411
+ foreach ( $items as $item ) {
412
+ $href = str_replace( '/', '', $item->getAttribute( 'href' ) ); //Remove trailing slash
413
+
414
+ if ( strpos( $href, 'http' ) === false && $href !== '..' ) {
415
+ $versions[] = $href;
416
+ }
417
+ }
418
+
419
+ $this->versions = array_reverse( $versions );
420
+
421
+ return $versions;
422
+ }
423
+
424
+ /**
425
+ * Versions Select
426
+ *
427
+ * Outputs the version radio buttons to select a rollback; types = 'plugin' or 'theme'.
428
+ *
429
+ * @param $type
430
+ *
431
+ * @return bool|string
432
+ */
433
+ public function versions_select( $type ) {
434
+
435
+ if ( ! $this->versions ) {
436
+ return false;
437
+ }
438
+
439
+ $versions_html = '';
440
+
441
+ usort( $this->versions, 'version_compare' );
442
+
443
+ $this->versions = array_reverse( $this->versions );
444
+
445
+ //Loop through versions and output in a radio list
446
+ foreach ( $this->versions as $version ) {
447
+
448
+ $versions_html .= '<label><input type="radio" value="' . esc_attr( $version ) . '" name="' . $type . '_version">' . $version;
449
+
450
+ //Is this the current version?
451
+ if ( $version === $this->current_version ) {
452
+ $versions_html .= '<span class="current-version">' . __( 'Installed Version', 'wp-rollback' ) . '</span>';
453
+ }
454
+
455
+ $versions_html .= '</label>';
456
+
457
+
458
+ }
459
+
460
+ return $versions_html;
461
+ }
462
+
463
+ /**
464
+ * Set Plugin Slug
465
+ *
466
+ * @return bool
467
+ */
468
+ private function set_plugin_slug() {
469
+
470
+ if ( ! isset( $_GET['plugin_file'] ) ) {
471
+ return false;
472
+ }
473
+
474
+ if ( isset( $_GET['current_version'] ) ) {
475
+ $curr_version = explode( ' ', $_GET['current_version'] );
476
+ $this->current_version = apply_filters( 'wpr_current_version', $curr_version[0] );
477
+ }
478
+
479
+ include_once ABSPATH . 'wp-admin/includes/plugin.php';
480
+
481
+ $plugin_file = WP_PLUGIN_DIR . '/' . $_GET['plugin_file'];
482
+
483
+ if ( ! file_exists( $plugin_file ) ) {
484
+ wp_die( 'Plugin you\'re referencing does not exist.' );
485
+ }
486
+
487
+ $plugin_data = get_plugin_data( $plugin_file, false, false );
488
+
489
+ //the plugin slug is the base directory name without the path to the main file
490
+ $plugin_slug = explode( '/', plugin_basename( $plugin_file ) );
491
+
492
+ $this->plugin_file = apply_filters( 'wpr_plugin_file', $plugin_file );
493
+ $this->plugin_slug = apply_filters( 'wpr_plugin_slug', $plugin_slug[0] );
494
+
495
+ return $plugin_slug;
496
+
497
+ }
498
+
499
+ /**
500
+ * Admin Menu
501
+ *
502
+ * @description: Adds a 'hidden' menu item that is activated when the user elects to rollback
503
+ */
504
+ public function admin_menu() {
505
+
506
+ //Only show menu item when necessary (user is interacting with plugin, ie rolling back something)
507
+ if ( isset( $_GET['page'] ) && $_GET['page'] == 'wp-rollback' ) {
508
+
509
+ //Add it in a native WP way, like WP updates do... (a dashboard page)
510
+ add_dashboard_page( __( 'Rollback', 'wp-rollback' ), __( 'Rollback', 'wp-rollback' ), 'update_plugins', 'wp-rollback', array(
511
+ self::$instance,
512
+ 'html'
513
+ ) );
514
+
515
+ }
516
+
517
+ }
518
+
519
+ /**
520
+ * Pre-Current Active Plugins
521
+ *
522
+ * @param $plugins
523
+ *
524
+ * @return mixed
525
+ */
526
+ public function pre_current_active_plugins( $plugins ) {
527
+ $updated = $plugins;
528
+ foreach ( $updated as $key => $value ) {
529
+ $updated[ $key ] = $value;
530
+ $updated[ $key ]['rollback'] = true;
531
+ }
532
+
533
+ return $updated;
534
+ }
535
+
536
+
537
+ /**
538
+ * Plugin Action Links
539
+ *
540
+ * Adds a "rollback" link into the plugins listing page w/ appropriate query strings
541
+ *
542
+ * @param $actions
543
+ * @param $plugin_file
544
+ * @param $plugin_data
545
+ * @param $context
546
+ *
547
+ * @return array $actions
548
+ */
549
+ public function plugin_action_links( $actions, $plugin_file, $plugin_data, $context ) {
550
+
551
+ //Base rollback URL
552
+ $rollback_url = 'index.php?page=wp-rollback&type=plugin&plugin_file=' . $plugin_file;
553
+
554
+ //Filter for other devs
555
+ $plugin_data = apply_filters( 'wpr_plugin_data', $plugin_data );
556
+
557
+ //If plugin is missing package data do not output Rollback option
558
+ if ( ! isset( $plugin_data['package'] ) || strpos( $plugin_data['package'], 'https://downloads.wordpress.org' ) === false ) {
559
+ return $actions;
560
+ }
561
+
562
+ //Add in the current version for later reference
563
+ if ( isset( $plugin_data['Version'] ) ) {
564
+ $rollback_url = add_query_arg( apply_filters( 'wpr_plugin_query_args', array(
565
+ 'current_version' => urlencode( $plugin_data['Version'] ),
566
+ 'rollback_name' => urlencode( $plugin_data['Name'] ),
567
+ '_wpnonce' => wp_create_nonce( 'wpr_rollback_nonce' )
568
+ ) ), $rollback_url );
569
+ }
570
+
571
+ //Final Output
572
+ $actions['rollback'] = apply_filters( 'wpr_plugin_markup', '<a href="' . esc_url( $rollback_url ) . '">' . __( 'Rollback', 'wp-rollback' ) . '</a>' );
573
+
574
+ return apply_filters( 'wpr_plugin_action_links', $actions );
575
+
576
+ }
577
+
578
+
579
+ /**
580
+ * Is WordPress Theme?
581
+ *
582
+ * Queries the WordPress.org API via theme's slug to see if this theme is on WordPress.
583
+ *
584
+ * @return bool
585
+ * @TODO Set transient here to speed up future checks?
586
+ */
587
+ public function is_wordpress_theme() {
588
+
589
+ $url = add_query_arg( 'request[slug]', $_POST['theme'], 'https://api.wordpress.org/themes/info/1.1/?action=theme_information' );
590
+ $wp_api = wp_remote_get( $url );
591
+
592
+ if ( ! is_wp_error( $wp_api ) ) {
593
+ if ( isset( $wp_api['body'] ) && strlen( $wp_api['body'] ) > 0 && $wp_api['body'] !== 'false' ) {
594
+ echo 'wp';
595
+ } else {
596
+ echo 'non-wp';
597
+ }
598
+ } else {
599
+ echo 'error';
600
+ }
601
+
602
+ // Die is required to terminate immediately and return a proper response.
603
+ wp_die();
604
+
605
+ return true;
606
+
607
+ }
608
+
609
+
610
+ /**
611
+ * Plugin Row Meta.
612
+ *
613
+ * @param $plugin_meta
614
+ * @param $plugin_file
615
+ * @param $plugin_data
616
+ * @param $status
617
+ *
618
+ * @return mixed
619
+ */
620
+ public function plugin_row_meta( $plugin_meta, $plugin_file, $plugin_data, $status ) {
621
+ return $plugin_meta;
622
+ }
623
+
624
+
625
+ /**
626
+ * Updates theme list.
627
+ *
628
+ * @return bool
629
+ */
630
+ function wpr_theme_updates_list() {
631
+
632
+ include( ABSPATH . WPINC . '/version.php' ); // include an unmodified $wp_version
633
+
634
+ //Bounce out if improperly called.
635
+ if ( defined( 'WP_INSTALLING' ) || ! is_admin() ) {
636
+ return false;
637
+ }
638
+
639
+ $expiration = 12 * HOUR_IN_SECONDS;
640
+ $installed_themes = wp_get_themes();
641
+
642
+ $last_update = get_site_transient( 'update_themes' );
643
+ if ( ! is_object( $last_update ) ) {
644
+ set_site_transient( 'rollback_themes', time(), $expiration );
645
+ }
646
+
647
+ $themes = $checked = $request = array();
648
+
649
+ // Put slug of current theme into request.
650
+ $request['active'] = get_option( 'stylesheet' );
651
+
652
+ foreach ( $installed_themes as $theme ) {
653
+ $checked[ $theme->get_stylesheet() ] = $theme->get( 'Version' );
654
+
655
+ $themes[ $theme->get_stylesheet() ] = array(
656
+ 'Name' => $theme->get( 'Name' ),
657
+ 'Title' => $theme->get( 'Name' ),
658
+ 'Version' => '0.0.0.0.0.0',
659
+ 'Author' => $theme->get( 'Author' ),
660
+ 'Author URI' => $theme->get( 'AuthorURI' ),
661
+ 'Template' => $theme->get_template(),
662
+ 'Stylesheet' => $theme->get_stylesheet(),
663
+ );
664
+ }
665
+
666
+ $request['themes'] = $themes;
667
+
668
+ $timeout = 3 + (int) ( count( $themes ) / 10 );
669
+
670
+ $options = array(
671
+ 'timeout' => $timeout,
672
+ 'body' => array(
673
+ 'themes' => json_encode( $request ),
674
+ ),
675
+ 'user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' )
676
+ );
677
+
678
+ $url = $http_url = 'http://api.wordpress.org/themes/update-check/1.1/';
679
+ if ( $ssl = wp_http_supports( array( 'ssl' ) ) ) {
680
+ $url = set_url_scheme( $url, 'https' );
681
+ }
682
+
683
+ $raw_response = wp_remote_post( $url, $options );
684
+ if ( $ssl && is_wp_error( $raw_response ) ) {
685
+ trigger_error( __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href="https://wordpress.org/support/">support forums</a>.', 'wp-rollback' ) . ' ' . __( '(WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.)', 'wp-rollback' ), headers_sent() || WP_DEBUG ? E_USER_WARNING : E_USER_NOTICE );
686
+ $raw_response = wp_remote_post( $http_url, $options );
687
+ }
688
+
689
+ set_site_transient( 'rollback_themes', time(), $expiration );
690
+
691
+ if ( is_wp_error( $raw_response ) || 200 != wp_remote_retrieve_response_code( $raw_response ) ) {
692
+ return false;
693
+ }
694
+
695
+ $new_update = new stdClass;
696
+ $new_update->last_checked = time();
697
+ $new_update->checked = $checked;
698
+
699
+ $response = json_decode( wp_remote_retrieve_body( $raw_response ), true );
700
+
701
+ if ( is_array( $response ) && isset($response['themes'])) {
702
+ $new_update->response = $response['themes'];
703
+ }
704
+
705
+ set_site_transient( 'rollback_themes', $new_update );
706
+
707
+ return true;
708
+
709
+ }
710
+
711
+
712
+ /**
713
+ * Prepare Themes JS.
714
+ *
715
+ * @param $prepared_themes
716
+ *
717
+ * @return array
718
+ */
719
+ function wpr_prepare_themes_js( $prepared_themes ) {
720
+ $themes = array();
721
+ $rollbacks = array();
722
+ $wp_themes = get_site_transient( 'rollback_themes' );
723
+
724
+ //Double check our transient is present.
725
+ if(empty($wp_themes) || !is_object($wp_themes)) {
726
+ $this->wpr_theme_updates_list();
727
+ $wp_themes = get_site_transient( 'rollback_themes' );
728
+ }
729
+
730
+ //Set $rollback response variable for loop ahead.
731
+ if ( is_object( $wp_themes ) ) {
732
+ $rollbacks = $wp_themes->response;
733
+ }
734
+
735
+ //Loop through themes and provide a 'hasRollback' boolean key for JS.
736
+ foreach ( $prepared_themes as $key => $value ) {
737
+ $themes[ $key ] = $prepared_themes[ $key ];
738
+ $themes[ $key ]['hasRollback'] = isset( $rollbacks[ $key ] );
739
+ }
740
+
741
+ return $themes;
742
+ }
743
+
744
+
745
+ }
746
+ }
747
+
748
+ endif; // End if class_exists check
749
+
750
+
751
+ /**
752
+ * The main function responsible for returning the one true WP Rollback
753
+ * Instance to functions everywhere.
754
+ *
755
+ * Use this function like you would a global variable, except without needing
756
+ * to declare the global.
757
+ *
758
+ * Example: <?php $wp_rollback = WP_Rollback(); ?>
759
+ *
760
+ * @since 1.0
761
+ * @return object The one true WP Rollback Instance
762
+ */
763
+ function WP_Rollback() {
764
+ return WP_Rollback::instance();
765
+ }
766
+
767
+ // Get WP Rollback Running
768
  WP_Rollback();