Advanced Ads - Version 1.8.13

Version Description

  • improved security of WP Admin forms and AJAX requests
  • added translation notice
  • fixed publish date showing up for newly created ads
  • fixed issue when searching for post IDs in the "Specific Pages" Display Condition
Download this release

Release Info

Developer webzunft
Plugin Icon 128x128 Advanced Ads
Version 1.8.13
Comparing to
See all releases

Code changes from version 1.8.12 to 1.8.13

admin/assets/js/admin-global.js CHANGED
@@ -13,7 +13,8 @@ jQuery( document ).ready(function () {
13
 
14
  var query = {
15
  action: 'advads-close-notice',
16
- notice: messagebox.attr('data-notice')
 
17
  };
18
  // send query
19
  jQuery.post(ajaxurl, query, function (r) {
@@ -29,7 +30,8 @@ jQuery( document ).ready(function () {
29
 
30
  var query = {
31
  action: 'advads-subscribe-notice',
32
- notice: this.dataset.notice
 
33
  };
34
  // send and close message
35
  jQuery.post(ajaxurl, query, function (r) {
13
 
14
  var query = {
15
  action: 'advads-close-notice',
16
+ notice: messagebox.attr('data-notice'),
17
+ nonce: advadsglobal.ajax_nonce
18
  };
19
  // send query
20
  jQuery.post(ajaxurl, query, function (r) {
30
 
31
  var query = {
32
  action: 'advads-subscribe-notice',
33
+ notice: this.dataset.notice,
34
+ nonce: advadsglobal.ajax_nonce
35
  };
36
  // send and close message
37
  jQuery.post(ajaxurl, query, function (r) {
admin/assets/js/admin.js CHANGED
@@ -13,7 +13,8 @@ jQuery( document ).ready(function ($) {
13
  data: {
14
  'action': 'load_ad_parameters_metabox',
15
  'ad_type': ad_type,
16
- 'ad_id': $( '#post_ID' ).val()
 
17
  },
18
  success: function (data, textStatus, XMLHttpRequest) {
19
  // toggle main content field
@@ -65,7 +66,8 @@ jQuery( document ).ready(function ($) {
65
  placement_type: placement_type,
66
  placement_slug: placement_slug,
67
  ad_id: $( '#post_ID' ).val(),
68
- options: options
 
69
  },
70
  success: function (r, textStatus, XMLHttpRequest) {
71
  $( '#advads-ad-injection-box *' ).hide();
@@ -502,6 +504,7 @@ jQuery( document ).ready(function ($) {
502
  var args = {
503
  data: {
504
  action: 'advads-adblock-rebuild-assets',
 
505
  },
506
  done: function( data, textStatus, jqXHR ) {
507
  var $advads_adblocker_wrapper = $( '#advads-adblocker-wrapper' );
@@ -600,6 +603,7 @@ function advads_term_search(field, callback) {
600
  // return ['post', 'poster'];
601
  var query = {
602
  action: 'advads-terms-search',
 
603
  };
604
 
605
  query.search = field.val();
@@ -636,7 +640,8 @@ function advads_post_search( searchParam, callback ) {
636
  var query = {
637
  action: 'advads-post-search',
638
  _ajax_linking_nonce: jQuery( '#_ajax_linking_nonce' ).val(),
639
- 'search': searchParam
 
640
  };
641
 
642
  var querying = true;
13
  data: {
14
  'action': 'load_ad_parameters_metabox',
15
  'ad_type': ad_type,
16
+ 'ad_id': $( '#post_ID' ).val(),
17
+ 'nonce': advadsglobal.ajax_nonce
18
  },
19
  success: function (data, textStatus, XMLHttpRequest) {
20
  // toggle main content field
66
  placement_type: placement_type,
67
  placement_slug: placement_slug,
68
  ad_id: $( '#post_ID' ).val(),
69
+ options: options,
70
+ nonce: advadsglobal.ajax_nonce
71
  },
72
  success: function (r, textStatus, XMLHttpRequest) {
73
  $( '#advads-ad-injection-box *' ).hide();
504
  var args = {
505
  data: {
506
  action: 'advads-adblock-rebuild-assets',
507
+ nonce: advadsglobal.ajax_nonce,
508
  },
509
  done: function( data, textStatus, jqXHR ) {
510
  var $advads_adblocker_wrapper = $( '#advads-adblocker-wrapper' );
603
  // return ['post', 'poster'];
604
  var query = {
605
  action: 'advads-terms-search',
606
+ nonce: advadsglobal.ajax_nonce
607
  };
608
 
609
  query.search = field.val();
640
  var query = {
641
  action: 'advads-post-search',
642
  _ajax_linking_nonce: jQuery( '#_ajax_linking_nonce' ).val(),
643
+ 'search': searchParam,
644
+ nonce: advadsglobal.ajax_nonce
645
  };
646
 
647
  var querying = true;
admin/assets/js/wizard.js CHANGED
@@ -134,6 +134,7 @@ var advads_wizard = {
134
  data: {
135
  action: 'advads-save-hide-wizard-state',
136
  hide_wizard: hide_wizard,
 
137
  },
138
  });
139
  },
134
  data: {
135
  action: 'advads-save-hide-wizard-state',
136
  hide_wizard: hide_wizard,
137
+ nonce: advadsglobal.ajax_nonce,
138
  },
139
  });
140
  },
admin/class-advanced-ads-admin.php CHANGED
@@ -188,6 +188,12 @@ class Advanced_Ads_Admin {
188
  // global js script
189
  wp_enqueue_script( $this->plugin_slug . '-admin-global-script', plugins_url( 'assets/js/admin-global.js', __FILE__ ), array('jquery'), ADVADS_VERSION );
190
  wp_enqueue_script( $this->plugin_slug . '-admin-find-adblocker', plugins_url( 'assets/js/advertisement.js', __FILE__ ), array(), ADVADS_VERSION );
 
 
 
 
 
 
191
 
192
  if( self::screen_belongs_to_advanced_ads() ){
193
  wp_register_script( $this->plugin_slug . '-admin-script', plugins_url( 'assets/js/admin.js', __FILE__ ), array( 'jquery', 'jquery-ui-autocomplete' , 'jquery-ui-button' ), ADVADS_VERSION );
@@ -399,6 +405,10 @@ class Advanced_Ads_Admin {
399
  parse_str( $_POST['formdata'], $form );
400
  }
401
 
 
 
 
 
402
  $text = '';
403
  if( isset( $form[ 'advanced_ads_disable_text' ] ) ){
404
  $text = implode( "\n\r", $form[ 'advanced_ads_disable_text' ] );
188
  // global js script
189
  wp_enqueue_script( $this->plugin_slug . '-admin-global-script', plugins_url( 'assets/js/admin-global.js', __FILE__ ), array('jquery'), ADVADS_VERSION );
190
  wp_enqueue_script( $this->plugin_slug . '-admin-find-adblocker', plugins_url( 'assets/js/advertisement.js', __FILE__ ), array(), ADVADS_VERSION );
191
+
192
+ // register ajax nonce
193
+ $params = array(
194
+ 'ajax_nonce' => wp_create_nonce( 'advanced-ads-admin-ajax-nonce' ),
195
+ );
196
+ wp_localize_script( $this->plugin_slug . '-admin-global-script', 'advadsglobal', $params );
197
 
198
  if( self::screen_belongs_to_advanced_ads() ){
199
  wp_register_script( $this->plugin_slug . '-admin-script', plugins_url( 'assets/js/admin.js', __FILE__ ), array( 'jquery', 'jquery-ui-autocomplete' , 'jquery-ui-button' ), ADVADS_VERSION );
405
  parse_str( $_POST['formdata'], $form );
406
  }
407
 
408
+ if( ! wp_verify_nonce( $form[ 'advanced_ads_disable_form_nonce' ], 'advanced_ads_disable_form' ) ){
409
+ die();
410
+ }
411
+
412
  $text = '';
413
  if( isset( $form[ 'advanced_ads_disable_text' ] ) ){
414
  $text = implode( "\n\r", $form[ 'advanced_ads_disable_text' ] );
admin/includes/class-ad-groups-list.php CHANGED
@@ -166,24 +166,13 @@ class Advanced_Ads_Groups_List {
166
 
167
  $ad = new Advanced_Ads_Ad( get_the_ID() );
168
  $expiry_date_format = get_option( 'date_format' ). ', ' . get_option( 'time_format' );
169
- $post_start = get_the_date('Y-m-d H:i:s', $ad->id );
 
170
 
171
  $tz_option = get_option( 'timezone_string' );
172
- if ( $tz_option ) {
173
- $post_start = date_create( $post_start, Advanced_Ads_Admin::get_wp_timezone() );
174
- $post_start = absint( $post_start->format( 'U' ) );
175
- } else {
176
- $post_start = date_create( $post_start );
177
- $post_start = absint( $post_start->format( 'U' ) );
178
- $tz_name = Advanced_Ads_Admin::timezone_get_name( Advanced_Ads_Admin::get_wp_timezone() );
179
- $tz_offset = substr( $tz_name, 3 );
180
- $off_time = date_create( '2017-09-21 T10:44:02' . $tz_offset );
181
- $offset_in_sec = date_offset_get( $off_time );
182
- $post_start -= $offset_in_sec;
183
- }
184
 
185
  if ( $post_start > time() ) {
186
- $line_output .= '<br />' . sprintf( __( 'starts %s', 'advanced-ads' ), date( $expiry_date_format, $post_start ) );
187
  }
188
  if ( isset( $ad->expiry_date ) && $ad->expiry_date ) {
189
  $expiry = $ad->expiry_date;
166
 
167
  $ad = new Advanced_Ads_Ad( get_the_ID() );
168
  $expiry_date_format = get_option( 'date_format' ). ', ' . get_option( 'time_format' );
169
+
170
+ $post_start = get_post_time( 'U', true, $ad->id );
171
 
172
  $tz_option = get_option( 'timezone_string' );
 
 
 
 
 
 
 
 
 
 
 
 
173
 
174
  if ( $post_start > time() ) {
175
+ $line_output .= '<br />' . sprintf( __( 'starts %s', 'advanced-ads' ), get_date_from_gmt( date( 'Y-m-d H:i:s', $post_start ), $expiry_date_format ) );
176
  }
177
  if ( isset( $ad->expiry_date ) && $ad->expiry_date ) {
178
  $expiry = $ad->expiry_date;
admin/includes/class-ad-type.php CHANGED
@@ -145,7 +145,7 @@ class Advanced_Ads_Admin_Ad_Type {
145
 
146
  $expiry = false;
147
  $post_future = false;
148
- $post_start = get_the_date('U', $ad->id );
149
  $html_classes = 'advads-filter-timing';
150
  $expiry_date_format = get_option( 'date_format' ). ', ' . get_option( 'time_format' );
151
 
@@ -263,13 +263,12 @@ class Advanced_Ads_Admin_Ad_Type {
263
  */
264
  public function save_ad($post_id) {
265
 
266
- // only use for ads, no other post type
267
- if ( ! isset($_POST['post_type']) || $this->post_type != $_POST['post_type'] || ! isset($_POST['advanced_ad']['type']) ) {
268
- return;
269
- }
270
-
271
- // don’t do this on revisions
272
- if ( wp_is_post_revision( $post_id ) ) {
273
  return;
274
  }
275
 
145
 
146
  $expiry = false;
147
  $post_future = false;
148
+ $post_start = get_post_time('U', true, $ad->id );
149
  $html_classes = 'advads-filter-timing';
150
  $expiry_date_format = get_option( 'date_format' ). ', ' . get_option( 'time_format' );
151
 
263
  */
264
  public function save_ad($post_id) {
265
 
266
+ if ( ! current_user_can( Advanced_Ads_Plugin::user_cap( 'advanced_ads_edit_ads') )
267
+ // only use for ads, no other post type
268
+ || ! isset($_POST['post_type'])
269
+ || $this->post_type != $_POST['post_type']
270
+ || ! isset($_POST['advanced_ad']['type'])
271
+ || wp_is_post_revision( $post_id ) ) {
 
272
  return;
273
  }
274
 
admin/includes/class-meta-box.php CHANGED
@@ -321,7 +321,7 @@ class Advanced_Ads_Admin_Meta_Boxes {
321
  */
322
  public function close_ad_type_metabox( $classes = array() ) {
323
  global $post;
324
- if ( isset( $post->ID ) && 'edit' === $post->filter ) {
325
  if ( ! in_array( 'closed', $classes ) ) {
326
  $classes[] = 'closed';
327
  }
321
  */
322
  public function close_ad_type_metabox( $classes = array() ) {
323
  global $post;
324
+ if ( isset( $post->ID ) && 'publish' === $post->post_status ) {
325
  if ( ! in_array( 'closed', $classes ) ) {
326
  $classes[] = 'closed';
327
  }
admin/includes/class-overview-widgets.php CHANGED
@@ -14,6 +14,15 @@ class Advanced_Ads_Overview_Widgets_Callbacks {
14
  * @since 1.4.3
15
  */
16
  public static function setup_overview_widgets(){
 
 
 
 
 
 
 
 
 
17
 
18
  self::add_meta_box('advads_overview_news', __( 'Next steps', 'advanced-ads' ), 'left',
19
  'render_next_steps');
@@ -106,6 +115,9 @@ class Advanced_Ads_Overview_Widgets_Callbacks {
106
  <li><?php printf( __( '<a href="%s" target="_blank">FAQ and Support</a>', 'advanced-ads' ), ADVADS_URL . 'support/#utm_source=advanced-ads&utm_medium=link&utm_campaign=overview-support' ); ?></li>
107
  <li><?php printf( __( 'Thank the developer with a &#9733;&#9733;&#9733;&#9733;&#9733; review on <a href="%s" target="_blank">wordpress.org</a>', 'advanced-ads' ), 'https://wordpress.org/support/plugin/advanced-ads/reviews/?filter=5#new-post' ); ?></li>
108
  </ul><?php
 
 
 
109
  }
110
 
111
  /**
14
  * @since 1.4.3
15
  */
16
  public static function setup_overview_widgets(){
17
+
18
+ // initiate i18n notice
19
+ new Yoast_I18n_WordPressOrg_v3(
20
+ array(
21
+ 'textdomain' => 'advanced-ads',
22
+ 'plugin_name' => 'Advanced Ads',
23
+ 'hook' => 'advanced-ads-overview-below-support',
24
+ )
25
+ );
26
 
27
  self::add_meta_box('advads_overview_news', __( 'Next steps', 'advanced-ads' ), 'left',
28
  'render_next_steps');
115
  <li><?php printf( __( '<a href="%s" target="_blank">FAQ and Support</a>', 'advanced-ads' ), ADVADS_URL . 'support/#utm_source=advanced-ads&utm_medium=link&utm_campaign=overview-support' ); ?></li>
116
  <li><?php printf( __( 'Thank the developer with a &#9733;&#9733;&#9733;&#9733;&#9733; review on <a href="%s" target="_blank">wordpress.org</a>', 'advanced-ads' ), 'https://wordpress.org/support/plugin/advanced-ads/reviews/?filter=5#new-post' ); ?></li>
117
  </ul><?php
118
+
119
+ do_action( 'advanced-ads-overview-below-support' );
120
+
121
  }
122
 
123
  /**
admin/views/ad-display-metabox.php CHANGED
@@ -125,7 +125,8 @@ endif;
125
  data: {
126
  action: 'load_display_conditions_metabox',
127
  type: display_condition_type,
128
- index: display_condition_index
 
129
  },
130
  success: function (r, textStatus, XMLHttpRequest) {
131
  // add
125
  data: {
126
  action: 'load_display_conditions_metabox',
127
  type: display_condition_type,
128
+ index: display_condition_index,
129
+ nonce: advadsglobal.ajax_nonce
130
  },
131
  success: function (r, textStatus, XMLHttpRequest) {
132
  // add
admin/views/ad-list-timing-column.php CHANGED
@@ -1,7 +1,7 @@
1
  <fieldset class="inline-edit-col-left">
2
  <div class="inline-edit-col <?php echo $html_classes; ?>">
3
  <?php if ( $post_future ) : ?>
4
- <p><?php printf( __( 'starts %s', 'advanced-ads' ), date_i18n( $expiry_date_format, $post_future ) ); ?></p>
5
  <?php endif; ?>
6
  <?php if ( $expiry ) : ?>
7
  <?php
1
  <fieldset class="inline-edit-col-left">
2
  <div class="inline-edit-col <?php echo $html_classes; ?>">
3
  <?php if ( $post_future ) : ?>
4
+ <p><?php printf( __( 'starts %s', 'advanced-ads' ), get_date_from_gmt( date( 'Y-m-d H:i:s', $post_future ), $expiry_date_format ) ); ?></p>
5
  <?php endif; ?>
6
  <?php if ( $expiry ) : ?>
7
  <?php
admin/views/ad-visitor-metabox.php CHANGED
@@ -111,7 +111,8 @@ jQuery( document ).ready(function ($) {
111
  data: {
112
  action: 'load_visitor_conditions_metabox',
113
  type: visitor_condition_type,
114
- index: visitor_condition_index
 
115
  },
116
  success: function (r, textStatus, XMLHttpRequest) {
117
  // add
111
  data: {
112
  action: 'load_visitor_conditions_metabox',
113
  type: visitor_condition_type,
114
+ index: visitor_condition_index,
115
+ nonce: advadsglobal.ajax_nonce
116
  },
117
  success: function (r, textStatus, XMLHttpRequest) {
118
  // add
admin/views/feedback-disable.php CHANGED
@@ -24,6 +24,7 @@
24
  <?php endif; ?>
25
  <input class="advanced-ads-feedback-submit button button-primary" type="submit" name="advanced_ads_disable_submit" value="<?php _e('Submit & Deactivate', 'advanced-ads'); ?>"/>
26
  <input class="advanced-ads-feedback-not-deactivate advanced-ads-feedback-submit button" type="submit" name="advanced_ads_keep_submit" value="<?php _e('Keep it & get a reply within 12h', 'advanced-ads'); ?>">
 
27
  <a class="advanced-ads-feedback-only-deactivate" href="#"><?php _e('Only Deactivate', 'advanced-ads'); ?></a>
28
  </form>
29
  </div>
24
  <?php endif; ?>
25
  <input class="advanced-ads-feedback-submit button button-primary" type="submit" name="advanced_ads_disable_submit" value="<?php _e('Submit & Deactivate', 'advanced-ads'); ?>"/>
26
  <input class="advanced-ads-feedback-not-deactivate advanced-ads-feedback-submit button" type="submit" name="advanced_ads_keep_submit" value="<?php _e('Keep it & get a reply within 12h', 'advanced-ads'); ?>">
27
+ <?php wp_nonce_field( 'advanced_ads_disable_form', 'advanced_ads_disable_form_nonce' ); ?>
28
  <a class="advanced-ads-feedback-only-deactivate" href="#"><?php _e('Only Deactivate', 'advanced-ads'); ?></a>
29
  </form>
30
  </div>
advanced-ads.php CHANGED
@@ -12,9 +12,9 @@
12
  * Plugin Name: Advanced Ads
13
  * Plugin URI: https://wpadvancedads.com
14
  * Description: Manage and optimize your ads in WordPress
15
- * Version: 1.8.12
16
  * Author: Thomas Maier
17
- * Author URI: http://webgilde.com
18
  * Text Domain: advanced-ads
19
  * Domain Path: /languages
20
  * License: GPL-2.0+
@@ -39,7 +39,7 @@ define( 'ADVADS_BASE_DIR', dirname( ADVADS_BASE ) ); // directory of the plugin
39
  // general and global slug, e.g. to store options in WP, textdomain
40
  define( 'ADVADS_SLUG', 'advanced-ads' );
41
  define( 'ADVADS_URL', 'https://wpadvancedads.com/' );
42
- define( 'ADVADS_VERSION', '1.8.12' );
43
 
44
  /*----------------------------------------------------------------------------*
45
  * Autoloading, modules and functions
12
  * Plugin Name: Advanced Ads
13
  * Plugin URI: https://wpadvancedads.com
14
  * Description: Manage and optimize your ads in WordPress
15
+ * Version: 1.8.13
16
  * Author: Thomas Maier
17
+ * Author URI: https://wpadvancedads.com
18
  * Text Domain: advanced-ads
19
  * Domain Path: /languages
20
  * License: GPL-2.0+
39
  // general and global slug, e.g. to store options in WP, textdomain
40
  define( 'ADVADS_SLUG', 'advanced-ads' );
41
  define( 'ADVADS_URL', 'https://wpadvancedads.com/' );
42
+ define( 'ADVADS_VERSION', '1.8.13' );
43
 
44
  /*----------------------------------------------------------------------------*
45
  * Autoloading, modules and functions
classes/ad_ajax_callbacks.php CHANGED
@@ -43,6 +43,9 @@ class Advanced_Ads_Ad_Ajax_Callbacks {
43
  * @since 1.0.0
44
  */
45
  public function load_ad_parameters_metabox() {
 
 
 
46
  if ( ! current_user_can( Advanced_Ads_Plugin::user_cap( 'advanced_ads_edit_ads') ) ) {
47
  return;
48
  }
@@ -73,6 +76,9 @@ class Advanced_Ads_Ad_Ajax_Callbacks {
73
  * @since 1.5.4
74
  */
75
  public function load_visitor_condition() {
 
 
 
76
  if( ! current_user_can( Advanced_Ads_Plugin::user_cap( 'advanced_ads_edit_ads') ) ) {
77
  return;
78
  }
@@ -101,6 +107,9 @@ class Advanced_Ads_Ad_Ajax_Callbacks {
101
  * @since 1.7
102
  */
103
  public function load_display_condition() {
 
 
 
104
  if( ! current_user_can( Advanced_Ads_Plugin::user_cap( 'advanced_ads_edit_ads') ) ) {
105
  return;
106
  }
@@ -132,9 +141,12 @@ class Advanced_Ads_Ad_Ajax_Callbacks {
132
  * @sinc 1.4.7
133
  */
134
  public function search_terms(){
135
- if ( ! current_user_can( Advanced_Ads_Plugin::user_cap( 'advanced_ads_edit_ads') ) ) {
136
- return;
137
- }
 
 
 
138
 
139
  $args = array();
140
  $taxonomy = $_POST['tax'];
@@ -162,13 +174,16 @@ class Advanced_Ads_Ad_Ajax_Callbacks {
162
  * @since 1.5.3
163
  */
164
  public function close_notice(){
165
- if ( ! current_user_can( Advanced_Ads_Plugin::user_cap( 'advanced_ads_manage_options') ) ) {
166
- return;
167
- }
168
-
169
- if ( !isset( $_POST['notice'] ) || $_POST['notice'] === '' ) { die(); }
 
 
 
170
 
171
- Advanced_Ads_Admin_Notices::get_instance()->remove_from_queue($_POST['notice']);
172
  die();
173
  }
174
 
@@ -178,13 +193,16 @@ class Advanced_Ads_Ad_Ajax_Callbacks {
178
  * @since 1.5.3
179
  */
180
  public function subscribe(){
181
- if ( ! current_user_can( Advanced_Ads_Plugin::user_cap( 'advanced_ads_see_interface') ) ) {
182
- return;
183
- }
184
-
185
- if ( !isset( $_POST['notice'] ) || $_POST['notice'] === '' ) { die(); }
 
 
 
186
 
187
- echo Advanced_Ads_Admin_Notices::get_instance()->subscribe($_POST['notice']);
188
  die();
189
  }
190
 
@@ -194,9 +212,9 @@ class Advanced_Ads_Ad_Ajax_Callbacks {
194
  * @since 1.5.7
195
  */
196
  public function activate_license(){
197
- if ( ! current_user_can( Advanced_Ads_Plugin::user_cap( 'advanced_ads_manage_options') ) ) {
198
- return;
199
- }
200
 
201
  // check nonce
202
  check_ajax_referer( 'advads_ajax_license_nonce', 'security' );
@@ -214,9 +232,9 @@ class Advanced_Ads_Ad_Ajax_Callbacks {
214
  * @since 1.6.11
215
  */
216
  public function deactivate_license(){
217
- if ( ! current_user_can( Advanced_Ads_Plugin::user_cap( 'advanced_ads_manage_options') ) ) {
218
- return;
219
- }
220
 
221
  // check nonce
222
  check_ajax_referer( 'advads_ajax_license_nonce', 'security' );
@@ -233,12 +251,15 @@ class Advanced_Ads_Ad_Ajax_Callbacks {
233
  *
234
  */
235
  public function adblock_rebuild_assets(){
236
- if ( ! current_user_can( Advanced_Ads_Plugin::user_cap( 'advanced_ads_manage_options') ) ) {
237
- return;
238
- }
 
 
 
239
 
240
- Advanced_Ads_Ad_Blocker_Admin::get_instance()->add_asset_rebuild_form();
241
- die();
242
  }
243
 
244
  /**
@@ -246,6 +267,9 @@ class Advanced_Ads_Ad_Ajax_Callbacks {
246
  *
247
  */
248
  public function post_search(){
 
 
 
249
  if ( ! current_user_can( Advanced_Ads_Plugin::user_cap( 'advanced_ads_edit_ads') ) ) {
250
  return;
251
  }
@@ -262,6 +286,9 @@ class Advanced_Ads_Ad_Ajax_Callbacks {
262
  * @since 1.7.3
263
  */
264
  public function inject_placement(){
 
 
 
265
  if ( ! current_user_can( Advanced_Ads_Plugin::user_cap( 'advanced_ads_edit_ads') ) ) {
266
  die();
267
  }
@@ -346,6 +373,9 @@ class Advanced_Ads_Ad_Ajax_Callbacks {
346
  * @since 1.7.4
347
  */
348
  public function save_wizard_state(){
 
 
 
349
  if ( ! current_user_can( Advanced_Ads_Plugin::user_cap( 'advanced_ads_edit_ads') ) ) {
350
  return;
351
  }
43
  * @since 1.0.0
44
  */
45
  public function load_ad_parameters_metabox() {
46
+
47
+ check_ajax_referer('advanced-ads-admin-ajax-nonce', 'nonce');
48
+
49
  if ( ! current_user_can( Advanced_Ads_Plugin::user_cap( 'advanced_ads_edit_ads') ) ) {
50
  return;
51
  }
76
  * @since 1.5.4
77
  */
78
  public function load_visitor_condition() {
79
+
80
+ check_ajax_referer('advanced-ads-admin-ajax-nonce', 'nonce');
81
+
82
  if( ! current_user_can( Advanced_Ads_Plugin::user_cap( 'advanced_ads_edit_ads') ) ) {
83
  return;
84
  }
107
  * @since 1.7
108
  */
109
  public function load_display_condition() {
110
+
111
+ check_ajax_referer('advanced-ads-admin-ajax-nonce', 'nonce');
112
+
113
  if( ! current_user_can( Advanced_Ads_Plugin::user_cap( 'advanced_ads_edit_ads') ) ) {
114
  return;
115
  }
141
  * @sinc 1.4.7
142
  */
143
  public function search_terms(){
144
+
145
+ check_ajax_referer('advanced-ads-admin-ajax-nonce', 'nonce');
146
+
147
+ if ( ! current_user_can( Advanced_Ads_Plugin::user_cap( 'advanced_ads_edit_ads') ) ) {
148
+ return;
149
+ }
150
 
151
  $args = array();
152
  $taxonomy = $_POST['tax'];
174
  * @since 1.5.3
175
  */
176
  public function close_notice(){
177
+
178
+ check_ajax_referer('advanced-ads-admin-ajax-nonce', 'nonce');
179
+
180
+ if ( ! current_user_can( Advanced_Ads_Plugin::user_cap( 'advanced_ads_manage_options') )
181
+ || empty( $_POST['notice'] )
182
+ ) {
183
+ die();
184
+ }
185
 
186
+ Advanced_Ads_Admin_Notices::get_instance()->remove_from_queue($_POST['notice']);
187
  die();
188
  }
189
 
193
  * @since 1.5.3
194
  */
195
  public function subscribe(){
196
+
197
+ check_ajax_referer('advanced-ads-admin-ajax-nonce', 'nonce');
198
+
199
+ if ( ! current_user_can( Advanced_Ads_Plugin::user_cap( 'advanced_ads_see_interface') )
200
+ || empty( $_POST['notice'] )
201
+ ) {
202
+ die();
203
+ }
204
 
205
+ echo Advanced_Ads_Admin_Notices::get_instance()->subscribe($_POST['notice']);
206
  die();
207
  }
208
 
212
  * @since 1.5.7
213
  */
214
  public function activate_license(){
215
+ if ( ! current_user_can( Advanced_Ads_Plugin::user_cap( 'advanced_ads_manage_options') ) ) {
216
+ return;
217
+ }
218
 
219
  // check nonce
220
  check_ajax_referer( 'advads_ajax_license_nonce', 'security' );
232
  * @since 1.6.11
233
  */
234
  public function deactivate_license(){
235
+ if ( ! current_user_can( Advanced_Ads_Plugin::user_cap( 'advanced_ads_manage_options') ) ) {
236
+ return;
237
+ }
238
 
239
  // check nonce
240
  check_ajax_referer( 'advads_ajax_license_nonce', 'security' );
251
  *
252
  */
253
  public function adblock_rebuild_assets(){
254
+
255
+ check_ajax_referer('advanced-ads-admin-ajax-nonce', 'nonce');
256
+
257
+ if ( ! current_user_can( Advanced_Ads_Plugin::user_cap( 'advanced_ads_manage_options') ) ) {
258
+ return;
259
+ }
260
 
261
+ Advanced_Ads_Ad_Blocker_Admin::get_instance()->add_asset_rebuild_form();
262
+ die();
263
  }
264
 
265
  /**
267
  *
268
  */
269
  public function post_search(){
270
+
271
+ check_ajax_referer('advanced-ads-admin-ajax-nonce', 'nonce');
272
+
273
  if ( ! current_user_can( Advanced_Ads_Plugin::user_cap( 'advanced_ads_edit_ads') ) ) {
274
  return;
275
  }
286
  * @since 1.7.3
287
  */
288
  public function inject_placement(){
289
+
290
+ check_ajax_referer('advanced-ads-admin-ajax-nonce', 'nonce');
291
+
292
  if ( ! current_user_can( Advanced_Ads_Plugin::user_cap( 'advanced_ads_edit_ads') ) ) {
293
  die();
294
  }
373
  * @since 1.7.4
374
  */
375
  public function save_wizard_state(){
376
+
377
+ check_ajax_referer('advanced-ads-admin-ajax-nonce', 'nonce');
378
+
379
  if ( ! current_user_can( Advanced_Ads_Plugin::user_cap( 'advanced_ads_edit_ads') ) ) {
380
  return;
381
  }
classes/ad_placements.php CHANGED
@@ -86,18 +86,18 @@ class Advanced_Ads_Placements {
86
  $success = null;
87
 
88
  if ( isset($_POST['advads']['placement']) && check_admin_referer( 'advads-placement', 'advads_placement' ) ){
89
- $success = self::save_new_placement( $_POST['advads']['placement'] );
90
  }
91
  // save placement data
92
  if ( isset($_POST['advads']['placements']) && check_admin_referer( 'advads-placement', 'advads_placement' )){
93
- $success = self::save_placements( $_POST['advads']['placements'] );
94
  }
95
 
96
  $success = apply_filters( 'advanced-ads-update-placements', $success );
97
 
98
  if(isset($success)){
99
- $message = $success ? 'updated' : 'error';
100
- wp_redirect( esc_url_raw( add_query_arg(array('message' => $message)) ) );
101
  }
102
  }
103
 
86
  $success = null;
87
 
88
  if ( isset($_POST['advads']['placement']) && check_admin_referer( 'advads-placement', 'advads_placement' ) ){
89
+ $success = self::save_new_placement( $_POST['advads']['placement'] );
90
  }
91
  // save placement data
92
  if ( isset($_POST['advads']['placements']) && check_admin_referer( 'advads-placement', 'advads_placement' )){
93
+ $success = self::save_placements( $_POST['advads']['placements'] );
94
  }
95
 
96
  $success = apply_filters( 'advanced-ads-update-placements', $success );
97
 
98
  if(isset($success)){
99
+ $message = $success ? 'updated' : 'error';
100
+ wp_redirect( esc_url_raw( add_query_arg(array('message' => $message)) ) );
101
  }
102
  }
103
 
classes/ad_type_group.php CHANGED
@@ -34,7 +34,7 @@ class Advanced_Ads_Ad_Type_Group extends Advanced_Ads_Ad_Type_Abstract{
34
  );
35
 
36
  // on save, remove the group in which the ad is itself to prevent infinite loops
37
- add_action( 'save_post', array($this, 'remove_from_ad_group'), 1 );
38
  }
39
 
40
  /**
34
  );
35
 
36
  // on save, remove the group in which the ad is itself to prevent infinite loops
37
+ add_action( 'save_post_advanced_ads', array($this, 'remove_from_ad_group'), 1 );
38
  }
39
 
40
  /**
classes/display-conditions.php CHANGED
@@ -1113,6 +1113,13 @@ class Advanced_Ads_Display_Conditions {
1113
  * @return string
1114
  */
1115
  public static function modify_post_search( $query ) {
 
 
 
 
 
 
 
1116
  $query['suppress_filters'] = false;
1117
  $query['orderby'] = 'post_title';
1118
  $query['post_status'] = array( 'publish', 'pending', 'draft', 'future' );
@@ -1127,7 +1134,7 @@ class Advanced_Ads_Display_Conditions {
1127
  */
1128
  public static function modify_post_search_sql( $sql ) {
1129
  global $wpdb;
1130
-
1131
  $sql = preg_replace_callback( "/{$wpdb->posts}.post_(content|excerpt)( NOT)? LIKE '%(.*?)%'/", array( 'Advanced_Ads_Display_Conditions', 'modify_post_search_sql_callback' ), $sql );
1132
 
1133
  return $sql;
1113
  * @return string
1114
  */
1115
  public static function modify_post_search( $query ) {
1116
+
1117
+ // use ID and not search field if ID given
1118
+ if( 0 !== absint( $query['s'] ) && strlen( $query['s'] ) == strlen ( absint( $query['s'] ) ) ){
1119
+ $query['post__in'] = array( absint( $query['s'] ));
1120
+ unset( $query['s'] );
1121
+ }
1122
+
1123
  $query['suppress_filters'] = false;
1124
  $query['orderby'] = 'post_title';
1125
  $query['post_status'] = array( 'publish', 'pending', 'draft', 'future' );
1134
  */
1135
  public static function modify_post_search_sql( $sql ) {
1136
  global $wpdb;
1137
+
1138
  $sql = preg_replace_callback( "/{$wpdb->posts}.post_(content|excerpt)( NOT)? LIKE '%(.*?)%'/", array( 'Advanced_Ads_Display_Conditions', 'modify_post_search_sql_callback' ), $sql );
1139
 
1140
  return $sql;
composer.json CHANGED
@@ -16,7 +16,8 @@
16
  },
17
  "require": {
18
  "composer/installers": "~1.0",
19
- "xrstf/composer-php52": "^1.0.17"
 
20
  },
21
  "autoload": {
22
  "classmap": [
@@ -41,4 +42,4 @@
41
  "dev-master": "1.x-dev"
42
  }
43
  }
44
- }
16
  },
17
  "require": {
18
  "composer/installers": "~1.0",
19
+ "xrstf/composer-php52": "^1.0.17",
20
+ "yoast/i18n-module": "^3.0"
21
  },
22
  "autoload": {
23
  "classmap": [
42
  "dev-master": "1.x-dev"
43
  }
44
  }
45
+ }
composer.lock CHANGED
@@ -4,8 +4,8 @@
4
  "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
5
  "This file is @generated automatically"
6
  ],
7
- "hash": "a5682b6980988f749640ce92382a6247",
8
- "content-hash": "ad3eee4861f3aff012912967c0a17906",
9
  "packages": [
10
  {
11
  "name": "composer/installers",
@@ -154,6 +154,44 @@
154
  "MIT"
155
  ],
156
  "time": "2016-04-16 21:52:24"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
157
  }
158
  ],
159
  "packages-dev": [],
4
  "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
5
  "This file is @generated automatically"
6
  ],
7
+ "hash": "d90f1cae4e4d32eda72adc8f042bc119",
8
+ "content-hash": "093d30b13bb01b276f01b798181d1a7f",
9
  "packages": [
10
  {
11
  "name": "composer/installers",
154
  "MIT"
155
  ],
156
  "time": "2016-04-16 21:52:24"
157
+ },
158
+ {
159
+ "name": "yoast/i18n-module",
160
+ "version": "3.0.0",
161
+ "source": {
162
+ "type": "git",
163
+ "url": "https://github.com/Yoast/i18n-module.git",
164
+ "reference": "76b1645aaf8cf9a07dc06ec0bbe2a6838feeed4c"
165
+ },
166
+ "dist": {
167
+ "type": "zip",
168
+ "url": "https://api.github.com/repos/Yoast/i18n-module/zipball/76b1645aaf8cf9a07dc06ec0bbe2a6838feeed4c",
169
+ "reference": "76b1645aaf8cf9a07dc06ec0bbe2a6838feeed4c",
170
+ "shasum": ""
171
+ },
172
+ "type": "library",
173
+ "autoload": {
174
+ "classmap": [
175
+ "src/"
176
+ ]
177
+ },
178
+ "notification-url": "https://packagist.org/downloads/",
179
+ "license": [
180
+ "GPL-2.0+"
181
+ ],
182
+ "authors": [
183
+ {
184
+ "name": "Team Yoast",
185
+ "email": "support@yoast.com",
186
+ "homepage": "https://yoast.com"
187
+ }
188
+ ],
189
+ "description": "Handle i18n for WordPress plugins.",
190
+ "homepage": "https://github.com/Yoast/i18n-module",
191
+ "keywords": [
192
+ "wordpress"
193
+ ],
194
+ "time": "2017-09-06 07:17:52"
195
  }
196
  ],
197
  "packages-dev": [],
modules/import-export/classes/import.php CHANGED
@@ -50,10 +50,12 @@ class Advanced_Ads_Import {
50
  * Manages stages of the XML import process
51
  */
52
  public function dispatch() {
53
- if ( ! current_user_can( Advanced_Ads_Plugin::user_cap( 'advanced_ads_manage_options') ) ) {
 
 
54
  return;
55
  }
56
-
57
  if ( ! isset( $_POST['import_type'] ) ) {
58
  return;
59
  }
50
  * Manages stages of the XML import process
51
  */
52
  public function dispatch() {
53
+ if ( ! isset( $_POST['_wpnonce'] )
54
+ || ! wp_verify_nonce( $_POST['_wpnonce'], 'advads-import' )
55
+ || ! current_user_can( Advanced_Ads_Plugin::user_cap( 'advanced_ads_manage_options') ) ) {
56
  return;
57
  }
58
+
59
  if ( ! isset( $_POST['import_type'] ) ) {
60
  return;
61
  }
modules/import-export/views/page.php CHANGED
@@ -62,7 +62,6 @@ class_exists( 'Advanced_Ads', false ) || exit();
62
  <div id="advads_xml_content" style="display:none;">
63
  <p><textarea id="xml_textarea" name="xml_textarea" rows="10" cols="20" class="large-text code"></textarea></p>
64
  </div>
65
-
66
  <?php submit_button( __( 'Start import', 'advanced-ads' ), 'primary' ); ?>
67
  </form>
68
 
62
  <div id="advads_xml_content" style="display:none;">
63
  <p><textarea id="xml_textarea" name="xml_textarea" rows="10" cols="20" class="large-text code"></textarea></p>
64
  </div>
 
65
  <?php submit_button( __( 'Start import', 'advanced-ads' ), 'primary' ); ?>
66
  </form>
67
 
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: ads, ad, ad inserter, ad injection, ad manager, ads manager, ad widget, ad
5
  Requires at least: 4.6
6
  Tested up to: 4.8
7
  Requires PHP: 5.2
8
- Stable tag: 1.8.12
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -103,6 +103,7 @@ Placements to insert ads in pre-defined positions in your theme and content. [Li
103
  * insert AdSense verification, Page-Level ads and QuickStart code
104
  * Ad Health integration and AdSense violation checks
105
  * option to make the AdSense background transparent
 
106
  * assistant for exact sizes of responsive ads with the [Responsive add-on](https://wpadvancedads.com/add-ons/responsive-ads/)
107
 
108
  = ad blocker =
@@ -229,6 +230,13 @@ Yes. Advanced Ads is based on WordPress standards and therefore easily customiza
229
 
230
  == Changelog ==
231
 
 
 
 
 
 
 
 
232
  = 1.8.12 =
233
 
234
  * linked the new [AdSense In-feed add-on](https://wordpress.org/plugins/advanced-ads-adsense-in-feed/) where needed
5
  Requires at least: 4.6
6
  Tested up to: 4.8
7
  Requires PHP: 5.2
8
+ Stable tag: 1.8.13
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
103
  * insert AdSense verification, Page-Level ads and QuickStart code
104
  * Ad Health integration and AdSense violation checks
105
  * option to make the AdSense background transparent
106
+ * place In-feed ads using the also free [In-feed add-on](https://wordpress.org/plugins/advanced-ads-adsense-in-feed/)
107
  * assistant for exact sizes of responsive ads with the [Responsive add-on](https://wpadvancedads.com/add-ons/responsive-ads/)
108
 
109
  = ad blocker =
230
 
231
  == Changelog ==
232
 
233
+ = 1.8.13 =
234
+
235
+ * improved security of WP Admin forms and AJAX requests
236
+ * added translation notice
237
+ * fixed publish date showing up for newly created ads
238
+ * fixed issue when searching for post IDs in the "Specific Pages" Display Condition
239
+
240
  = 1.8.12 =
241
 
242
  * linked the new [AdSense In-feed add-on](https://wordpress.org/plugins/advanced-ads-adsense-in-feed/) where needed
vendor/autoload_52.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once dirname(__FILE__) . '/composer'.'/autoload_real_52.php';
6
 
7
- return ComposerAutoloaderInitb09ada410711abc7e69787cd8b146329::getLoader();
4
 
5
  require_once dirname(__FILE__) . '/composer'.'/autoload_real_52.php';
6
 
7
+ return ComposerAutoloaderInit8c8717643e7ea9dbcecc89851b385e7c::getLoader();
vendor/composer/autoload_classmap.php CHANGED
@@ -43,91 +43,6 @@ return array(
43
  'Advanced_Ads_Utils' => $baseDir . '/classes/utils.php',
44
  'Advanced_Ads_Visitor_Conditions' => $baseDir . '/classes/visitor-conditions.php',
45
  'Advanced_Ads_Widget' => $baseDir . '/classes/widget.php',
46
- 'Composer\\Installers\\AglInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/AglInstaller.php',
47
- 'Composer\\Installers\\AimeosInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/AimeosInstaller.php',
48
- 'Composer\\Installers\\AnnotateCmsInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/AnnotateCmsInstaller.php',
49
- 'Composer\\Installers\\AsgardInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/AsgardInstaller.php',
50
- 'Composer\\Installers\\AttogramInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/AttogramInstaller.php',
51
- 'Composer\\Installers\\BaseInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/BaseInstaller.php',
52
- 'Composer\\Installers\\BitrixInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/BitrixInstaller.php',
53
- 'Composer\\Installers\\BonefishInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/BonefishInstaller.php',
54
- 'Composer\\Installers\\CakePHPInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/CakePHPInstaller.php',
55
- 'Composer\\Installers\\ChefInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ChefInstaller.php',
56
- 'Composer\\Installers\\ClanCatsFrameworkInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ClanCatsFrameworkInstaller.php',
57
- 'Composer\\Installers\\CockpitInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/CockpitInstaller.php',
58
- 'Composer\\Installers\\CodeIgniterInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/CodeIgniterInstaller.php',
59
- 'Composer\\Installers\\Concrete5Installer' => $vendorDir . '/composer/installers/src/Composer/Installers/Concrete5Installer.php',
60
- 'Composer\\Installers\\CraftInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/CraftInstaller.php',
61
- 'Composer\\Installers\\CroogoInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/CroogoInstaller.php',
62
- 'Composer\\Installers\\DecibelInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/DecibelInstaller.php',
63
- 'Composer\\Installers\\DokuWikiInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/DokuWikiInstaller.php',
64
- 'Composer\\Installers\\DolibarrInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/DolibarrInstaller.php',
65
- 'Composer\\Installers\\DrupalInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/DrupalInstaller.php',
66
- 'Composer\\Installers\\ElggInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ElggInstaller.php',
67
- 'Composer\\Installers\\EliasisInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/EliasisInstaller.php',
68
- 'Composer\\Installers\\ExpressionEngineInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ExpressionEngineInstaller.php',
69
- 'Composer\\Installers\\EzPlatformInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/EzPlatformInstaller.php',
70
- 'Composer\\Installers\\FuelInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/FuelInstaller.php',
71
- 'Composer\\Installers\\FuelphpInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/FuelphpInstaller.php',
72
- 'Composer\\Installers\\GravInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/GravInstaller.php',
73
- 'Composer\\Installers\\HuradInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/HuradInstaller.php',
74
- 'Composer\\Installers\\ImageCMSInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ImageCMSInstaller.php',
75
- 'Composer\\Installers\\Installer' => $vendorDir . '/composer/installers/src/Composer/Installers/Installer.php',
76
- 'Composer\\Installers\\ItopInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ItopInstaller.php',
77
- 'Composer\\Installers\\JoomlaInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/JoomlaInstaller.php',
78
- 'Composer\\Installers\\KanboardInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/KanboardInstaller.php',
79
- 'Composer\\Installers\\KirbyInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/KirbyInstaller.php',
80
- 'Composer\\Installers\\KodiCMSInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/KodiCMSInstaller.php',
81
- 'Composer\\Installers\\KohanaInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/KohanaInstaller.php',
82
- 'Composer\\Installers\\LanManagementSystemInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/LanManagementSystemInstaller.php',
83
- 'Composer\\Installers\\LaravelInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/LaravelInstaller.php',
84
- 'Composer\\Installers\\LavaLiteInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/LavaLiteInstaller.php',
85
- 'Composer\\Installers\\LithiumInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/LithiumInstaller.php',
86
- 'Composer\\Installers\\MODULEWorkInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MODULEWorkInstaller.php',
87
- 'Composer\\Installers\\MODXEvoInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MODXEvoInstaller.php',
88
- 'Composer\\Installers\\MagentoInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MagentoInstaller.php',
89
- 'Composer\\Installers\\MakoInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MakoInstaller.php',
90
- 'Composer\\Installers\\MauticInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MauticInstaller.php',
91
- 'Composer\\Installers\\MayaInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MayaInstaller.php',
92
- 'Composer\\Installers\\MediaWikiInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MediaWikiInstaller.php',
93
- 'Composer\\Installers\\MicroweberInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MicroweberInstaller.php',
94
- 'Composer\\Installers\\MoodleInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MoodleInstaller.php',
95
- 'Composer\\Installers\\OctoberInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/OctoberInstaller.php',
96
- 'Composer\\Installers\\OntoWikiInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/OntoWikiInstaller.php',
97
- 'Composer\\Installers\\OsclassInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/OsclassInstaller.php',
98
- 'Composer\\Installers\\OxidInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/OxidInstaller.php',
99
- 'Composer\\Installers\\PPIInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/PPIInstaller.php',
100
- 'Composer\\Installers\\PhiftyInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/PhiftyInstaller.php',
101
- 'Composer\\Installers\\PhpBBInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/PhpBBInstaller.php',
102
- 'Composer\\Installers\\PimcoreInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/PimcoreInstaller.php',
103
- 'Composer\\Installers\\PiwikInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/PiwikInstaller.php',
104
- 'Composer\\Installers\\PlentymarketsInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/PlentymarketsInstaller.php',
105
- 'Composer\\Installers\\Plugin' => $vendorDir . '/composer/installers/src/Composer/Installers/Plugin.php',
106
- 'Composer\\Installers\\PortoInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/PortoInstaller.php',
107
- 'Composer\\Installers\\PrestashopInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/PrestashopInstaller.php',
108
- 'Composer\\Installers\\PuppetInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/PuppetInstaller.php',
109
- 'Composer\\Installers\\RadPHPInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/RadPHPInstaller.php',
110
- 'Composer\\Installers\\ReIndexInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ReIndexInstaller.php',
111
- 'Composer\\Installers\\RedaxoInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/RedaxoInstaller.php',
112
- 'Composer\\Installers\\RoundcubeInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/RoundcubeInstaller.php',
113
- 'Composer\\Installers\\SMFInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/SMFInstaller.php',
114
- 'Composer\\Installers\\ShopwareInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ShopwareInstaller.php',
115
- 'Composer\\Installers\\SilverStripeInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/SilverStripeInstaller.php',
116
- 'Composer\\Installers\\SyDESInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/SyDESInstaller.php',
117
- 'Composer\\Installers\\Symfony1Installer' => $vendorDir . '/composer/installers/src/Composer/Installers/Symfony1Installer.php',
118
- 'Composer\\Installers\\TYPO3CmsInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/TYPO3CmsInstaller.php',
119
- 'Composer\\Installers\\TYPO3FlowInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/TYPO3FlowInstaller.php',
120
- 'Composer\\Installers\\TheliaInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/TheliaInstaller.php',
121
- 'Composer\\Installers\\TuskInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/TuskInstaller.php',
122
- 'Composer\\Installers\\UserFrostingInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/UserFrostingInstaller.php',
123
- 'Composer\\Installers\\VanillaInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/VanillaInstaller.php',
124
- 'Composer\\Installers\\VgmcpInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/VgmcpInstaller.php',
125
- 'Composer\\Installers\\WHMCSInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/WHMCSInstaller.php',
126
- 'Composer\\Installers\\WolfCMSInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/WolfCMSInstaller.php',
127
- 'Composer\\Installers\\WordPressInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/WordPressInstaller.php',
128
- 'Composer\\Installers\\YawikInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/YawikInstaller.php',
129
- 'Composer\\Installers\\ZendInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ZendInstaller.php',
130
- 'Composer\\Installers\\ZikulaInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ZikulaInstaller.php',
131
- 'xrstf\\Composer52\\AutoloadGenerator' => $vendorDir . '/xrstf/composer-php52/lib/xrstf/Composer52/AutoloadGenerator.php',
132
- 'xrstf\\Composer52\\Generator' => $vendorDir . '/xrstf/composer-php52/lib/xrstf/Composer52/Generator.php',
133
  );
43
  'Advanced_Ads_Utils' => $baseDir . '/classes/utils.php',
44
  'Advanced_Ads_Visitor_Conditions' => $baseDir . '/classes/visitor-conditions.php',
45
  'Advanced_Ads_Widget' => $baseDir . '/classes/widget.php',
46
+ 'Yoast_I18n_WordPressOrg_v3' => $vendorDir . '/yoast/i18n-module/src/i18n-module-wordpressorg.php',
47
+ 'Yoast_I18n_v3' => $vendorDir . '/yoast/i18n-module/src/i18n-module.php',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
  );
vendor/composer/autoload_real_52.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real_52.php generated by xrstf/composer-php52
4
 
5
- class ComposerAutoloaderInitb09ada410711abc7e69787cd8b146329 {
6
  private static $loader;
7
 
8
  public static function loadClassLoader($class) {
@@ -19,9 +19,9 @@ class ComposerAutoloaderInitb09ada410711abc7e69787cd8b146329 {
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInitb09ada410711abc7e69787cd8b146329', 'loadClassLoader'), true /*, true */);
23
  self::$loader = $loader = new xrstf_Composer52_ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInitb09ada410711abc7e69787cd8b146329', 'loadClassLoader'));
25
 
26
  $vendorDir = dirname(dirname(__FILE__));
27
  $baseDir = dirname($vendorDir);
2
 
3
  // autoload_real_52.php generated by xrstf/composer-php52
4
 
5
+ class ComposerAutoloaderInit8c8717643e7ea9dbcecc89851b385e7c {
6
  private static $loader;
7
 
8
  public static function loadClassLoader($class) {
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInit8c8717643e7ea9dbcecc89851b385e7c', 'loadClassLoader'), true /*, true */);
23
  self::$loader = $loader = new xrstf_Composer52_ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInit8c8717643e7ea9dbcecc89851b385e7c', 'loadClassLoader'));
25
 
26
  $vendorDir = dirname(dirname(__FILE__));
27
  $baseDir = dirname($vendorDir);
vendor/composer/installed.json CHANGED
@@ -150,5 +150,45 @@
150
  "zend",
151
  "zikula"
152
  ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
153
  }
154
  ]
150
  "zend",
151
  "zikula"
152
  ]
153
+ },
154
+ {
155
+ "name": "yoast/i18n-module",
156
+ "version": "3.0.0",
157
+ "version_normalized": "3.0.0.0",
158
+ "source": {
159
+ "type": "git",
160
+ "url": "https://github.com/Yoast/i18n-module.git",
161
+ "reference": "76b1645aaf8cf9a07dc06ec0bbe2a6838feeed4c"
162
+ },
163
+ "dist": {
164
+ "type": "zip",
165
+ "url": "https://api.github.com/repos/Yoast/i18n-module/zipball/76b1645aaf8cf9a07dc06ec0bbe2a6838feeed4c",
166
+ "reference": "76b1645aaf8cf9a07dc06ec0bbe2a6838feeed4c",
167
+ "shasum": ""
168
+ },
169
+ "time": "2017-09-06 07:17:52",
170
+ "type": "library",
171
+ "installation-source": "dist",
172
+ "autoload": {
173
+ "classmap": [
174
+ "src/"
175
+ ]
176
+ },
177
+ "notification-url": "https://packagist.org/downloads/",
178
+ "license": [
179
+ "GPL-2.0+"
180
+ ],
181
+ "authors": [
182
+ {
183
+ "name": "Team Yoast",
184
+ "email": "support@yoast.com",
185
+ "homepage": "https://yoast.com"
186
+ }
187
+ ],
188
+ "description": "Handle i18n for WordPress plugins.",
189
+ "homepage": "https://github.com/Yoast/i18n-module",
190
+ "keywords": [
191
+ "wordpress"
192
+ ]
193
  }
194
  ]
vendor/yoast/i18n-module/CHANGELOG.md ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Change Log
2
+ All notable changes to this project will be documented in this file.
3
+
4
+ The format is based on [Keep a Changelog](http://keepachangelog.com/)
5
+ and this project adheres to [Semantic Versioning](http://semver.org/).
6
+
7
+ ## 3.0.0
8
+
9
+ ### Added
10
+ - Added functionality to handle how the i18n-promobox notification is displayed.
11
+
12
+ ### Changed
13
+ - [DEPRECATION] Postfix all classes with _v3. This prevents autoload collisions with 2.0 versions.
14
+
15
+ ## 2.0.0
16
+
17
+ ### Added
18
+ - Add native support for WordPress.org
19
+
20
+ ### Changed
21
+ - [DEPRECATION] Postfix all classes with _v2. This prevents autoload collisions with 1.0 versions.
22
+
23
+ ## 1.2.1
24
+
25
+ ### Removed
26
+ - Remove backwards incompatible changes. These are only backwards incompatible in a WordPress context, but this is the target audience.
27
+
28
+ ## 1.2.0
29
+
30
+ ### Added
31
+ - Add native support for WordPress.org
32
+
33
+ ## 1.1.0
34
+
35
+ ### Changed
36
+ - Use the user locale for deciding whether to display the message to the user.
37
+
38
+ ## 1.0.1
39
+
40
+ ### Fixed
41
+ - Fix issue where a notice would be shown if the API response had no wp_locale.
42
+
43
+ ## 1.0.0
44
+
45
+ ### Added
46
+ - Initial release of the i18n module to show the user a notice about their
47
+ language not having been translated to 100%.
vendor/yoast/i18n-module/LICENSE ADDED
@@ -0,0 +1,675 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ GNU GENERAL PUBLIC LICENSE
2
+ Version 3, 29 June 2007
3
+
4
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
5
+ Everyone is permitted to copy and distribute verbatim copies
6
+ of this license document, but changing it is not allowed.
7
+
8
+ Preamble
9
+
10
+ The GNU General Public License is a free, copyleft license for
11
+ software and other kinds of works.
12
+
13
+ The licenses for most software and other practical works are designed
14
+ to take away your freedom to share and change the works. By contrast,
15
+ the GNU General Public License is intended to guarantee your freedom to
16
+ share and change all versions of a program--to make sure it remains free
17
+ software for all its users. We, the Free Software Foundation, use the
18
+ GNU General Public License for most of our software; it applies also to
19
+ any other work released this way by its authors. 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
+ them if you wish), that you receive source code or can get it if you
26
+ want it, that you can change the software or use pieces of it in new
27
+ free programs, and that you know you can do these things.
28
+
29
+ To protect your rights, we need to prevent others from denying you
30
+ these rights or asking you to surrender the rights. Therefore, you have
31
+ certain responsibilities if you distribute copies of the software, or if
32
+ you modify it: responsibilities to respect the freedom of others.
33
+
34
+ For example, if you distribute copies of such a program, whether
35
+ gratis or for a fee, you must pass on to the recipients the same
36
+ freedoms that you received. You must make sure that they, too, receive
37
+ or can get the source code. And you must show them these terms so they
38
+ know their rights.
39
+
40
+ Developers that use the GNU GPL protect your rights with two steps:
41
+ (1) assert copyright on the software, and (2) offer you this License
42
+ giving you legal permission to copy, distribute and/or modify it.
43
+
44
+ For the developers' and authors' protection, the GPL clearly explains
45
+ that there is no warranty for this free software. For both users' and
46
+ authors' sake, the GPL requires that modified versions be marked as
47
+ changed, so that their problems will not be attributed erroneously to
48
+ authors of previous versions.
49
+
50
+ Some devices are designed to deny users access to install or run
51
+ modified versions of the software inside them, although the manufacturer
52
+ can do so. This is fundamentally incompatible with the aim of
53
+ protecting users' freedom to change the software. The systematic
54
+ pattern of such abuse occurs in the area of products for individuals to
55
+ use, which is precisely where it is most unacceptable. Therefore, we
56
+ have designed this version of the GPL to prohibit the practice for those
57
+ products. If such problems arise substantially in other domains, we
58
+ stand ready to extend this provision to those domains in future versions
59
+ of the GPL, as needed to protect the freedom of users.
60
+
61
+ Finally, every program is threatened constantly by software patents.
62
+ States should not allow patents to restrict development and use of
63
+ software on general-purpose computers, but in those that do, we wish to
64
+ avoid the special danger that patents applied to a free program could
65
+ make it effectively proprietary. To prevent this, the GPL assures that
66
+ patents cannot be used to render the program non-free.
67
+
68
+ The precise terms and conditions for copying, distribution and
69
+ modification follow.
70
+
71
+ TERMS AND CONDITIONS
72
+
73
+ 0. Definitions.
74
+
75
+ "This License" refers to version 3 of the GNU General Public License.
76
+
77
+ "Copyright" also means copyright-like laws that apply to other kinds of
78
+ works, such as semiconductor masks.
79
+
80
+ "The Program" refers to any copyrightable work licensed under this
81
+ License. Each licensee is addressed as "you". "Licensees" and
82
+ "recipients" may be individuals or organizations.
83
+
84
+ To "modify" a work means to copy from or adapt all or part of the work
85
+ in a fashion requiring copyright permission, other than the making of an
86
+ exact copy. The resulting work is called a "modified version" of the
87
+ earlier work or a work "based on" the earlier work.
88
+
89
+ A "covered work" means either the unmodified Program or a work based
90
+ on the Program.
91
+
92
+ To "propagate" a work means to do anything with it that, without
93
+ permission, would make you directly or secondarily liable for
94
+ infringement under applicable copyright law, except executing it on a
95
+ computer or modifying a private copy. Propagation includes copying,
96
+ distribution (with or without modification), making available to the
97
+ public, and in some countries other activities as well.
98
+
99
+ To "convey" a work means any kind of propagation that enables other
100
+ parties to make or receive copies. Mere interaction with a user through
101
+ a computer network, with no transfer of a copy, is not conveying.
102
+
103
+ An interactive user interface displays "Appropriate Legal Notices"
104
+ to the extent that it includes a convenient and prominently visible
105
+ feature that (1) displays an appropriate copyright notice, and (2)
106
+ tells the user that there is no warranty for the work (except to the
107
+ extent that warranties are provided), that licensees may convey the
108
+ work under this License, and how to view a copy of this License. If
109
+ the interface presents a list of user commands or options, such as a
110
+ menu, a prominent item in the list meets this criterion.
111
+
112
+ 1. Source Code.
113
+
114
+ The "source code" for a work means the preferred form of the work
115
+ for making modifications to it. "Object code" means any non-source
116
+ form of a work.
117
+
118
+ A "Standard Interface" means an interface that either is an official
119
+ standard defined by a recognized standards body, or, in the case of
120
+ interfaces specified for a particular programming language, one that
121
+ is widely used among developers working in that language.
122
+
123
+ The "System Libraries" of an executable work include anything, other
124
+ than the work as a whole, that (a) is included in the normal form of
125
+ packaging a Major Component, but which is not part of that Major
126
+ Component, and (b) serves only to enable use of the work with that
127
+ Major Component, or to implement a Standard Interface for which an
128
+ implementation is available to the public in source code form. A
129
+ "Major Component", in this context, means a major essential component
130
+ (kernel, window system, and so on) of the specific operating system
131
+ (if any) on which the executable work runs, or a compiler used to
132
+ produce the work, or an object code interpreter used to run it.
133
+
134
+ The "Corresponding Source" for a work in object code form means all
135
+ the source code needed to generate, install, and (for an executable
136
+ work) run the object code and to modify the work, including scripts to
137
+ control those activities. However, it does not include the work's
138
+ System Libraries, or general-purpose tools or generally available free
139
+ programs which are used unmodified in performing those activities but
140
+ which are not part of the work. For example, Corresponding Source
141
+ includes interface definition files associated with source files for
142
+ the work, and the source code for shared libraries and dynamically
143
+ linked subprograms that the work is specifically designed to require,
144
+ such as by intimate data communication or control flow between those
145
+ subprograms and other parts of the work.
146
+
147
+ The Corresponding Source need not include anything that users
148
+ can regenerate automatically from other parts of the Corresponding
149
+ Source.
150
+
151
+ The Corresponding Source for a work in source code form is that
152
+ same work.
153
+
154
+ 2. Basic Permissions.
155
+
156
+ All rights granted under this License are granted for the term of
157
+ copyright on the Program, and are irrevocable provided the stated
158
+ conditions are met. This License explicitly affirms your unlimited
159
+ permission to run the unmodified Program. The output from running a
160
+ covered work is covered by this License only if the output, given its
161
+ content, constitutes a covered work. This License acknowledges your
162
+ rights of fair use or other equivalent, as provided by copyright law.
163
+
164
+ You may make, run and propagate covered works that you do not
165
+ convey, without conditions so long as your license otherwise remains
166
+ in force. You may convey covered works to others for the sole purpose
167
+ of having them make modifications exclusively for you, or provide you
168
+ with facilities for running those works, provided that you comply with
169
+ the terms of this License in conveying all material for which you do
170
+ not control copyright. Those thus making or running the covered works
171
+ for you must do so exclusively on your behalf, under your direction
172
+ and control, on terms that prohibit them from making any copies of
173
+ your copyrighted material outside their relationship with you.
174
+
175
+ Conveying under any other circumstances is permitted solely under
176
+ the conditions stated below. Sublicensing is not allowed; section 10
177
+ makes it unnecessary.
178
+
179
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180
+
181
+ No covered work shall be deemed part of an effective technological
182
+ measure under any applicable law fulfilling obligations under article
183
+ 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184
+ similar laws prohibiting or restricting circumvention of such
185
+ measures.
186
+
187
+ When you convey a covered work, you waive any legal power to forbid
188
+ circumvention of technological measures to the extent such circumvention
189
+ is effected by exercising rights under this License with respect to
190
+ the covered work, and you disclaim any intention to limit operation or
191
+ modification of the work as a means of enforcing, against the work's
192
+ users, your or third parties' legal rights to forbid circumvention of
193
+ technological measures.
194
+
195
+ 4. Conveying Verbatim Copies.
196
+
197
+ You may convey verbatim copies of the Program's source code as you
198
+ receive it, in any medium, provided that you conspicuously and
199
+ appropriately publish on each copy an appropriate copyright notice;
200
+ keep intact all notices stating that this License and any
201
+ non-permissive terms added in accord with section 7 apply to the code;
202
+ keep intact all notices of the absence of any warranty; and give all
203
+ recipients a copy of this License along with the Program.
204
+
205
+ You may charge any price or no price for each copy that you convey,
206
+ and you may offer support or warranty protection for a fee.
207
+
208
+ 5. Conveying Modified Source Versions.
209
+
210
+ You may convey a work based on the Program, or the modifications to
211
+ produce it from the Program, in the form of source code under the
212
+ terms of section 4, provided that you also meet all of these conditions:
213
+
214
+ a) The work must carry prominent notices stating that you modified
215
+ it, and giving a relevant date.
216
+
217
+ b) The work must carry prominent notices stating that it is
218
+ released under this License and any conditions added under section
219
+ 7. This requirement modifies the requirement in section 4 to
220
+ "keep intact all notices".
221
+
222
+ c) You must license the entire work, as a whole, under this
223
+ License to anyone who comes into possession of a copy. This
224
+ License will therefore apply, along with any applicable section 7
225
+ additional terms, to the whole of the work, and all its parts,
226
+ regardless of how they are packaged. This License gives no
227
+ permission to license the work in any other way, but it does not
228
+ invalidate such permission if you have separately received it.
229
+
230
+ d) If the work has interactive user interfaces, each must display
231
+ Appropriate Legal Notices; however, if the Program has interactive
232
+ interfaces that do not display Appropriate Legal Notices, your
233
+ work need not make them do so.
234
+
235
+ A compilation of a covered work with other separate and independent
236
+ works, which are not by their nature extensions of the covered work,
237
+ and which are not combined with it such as to form a larger program,
238
+ in or on a volume of a storage or distribution medium, is called an
239
+ "aggregate" if the compilation and its resulting copyright are not
240
+ used to limit the access or legal rights of the compilation's users
241
+ beyond what the individual works permit. Inclusion of a covered work
242
+ in an aggregate does not cause this License to apply to the other
243
+ parts of the aggregate.
244
+
245
+ 6. Conveying Non-Source Forms.
246
+
247
+ You may convey a covered work in object code form under the terms
248
+ of sections 4 and 5, provided that you also convey the
249
+ machine-readable Corresponding Source under the terms of this License,
250
+ in one of these ways:
251
+
252
+ a) Convey the object code in, or embodied in, a physical product
253
+ (including a physical distribution medium), accompanied by the
254
+ Corresponding Source fixed on a durable physical medium
255
+ customarily used for software interchange.
256
+
257
+ b) Convey the object code in, or embodied in, a physical product
258
+ (including a physical distribution medium), accompanied by a
259
+ written offer, valid for at least three years and valid for as
260
+ long as you offer spare parts or customer support for that product
261
+ model, to give anyone who possesses the object code either (1) a
262
+ copy of the Corresponding Source for all the software in the
263
+ product that is covered by this License, on a durable physical
264
+ medium customarily used for software interchange, for a price no
265
+ more than your reasonable cost of physically performing this
266
+ conveying of source, or (2) access to copy the
267
+ Corresponding Source from a network server at no charge.
268
+
269
+ c) Convey individual copies of the object code with a copy of the
270
+ written offer to provide the Corresponding Source. This
271
+ alternative is allowed only occasionally and noncommercially, and
272
+ only if you received the object code with such an offer, in accord
273
+ with subsection 6b.
274
+
275
+ d) Convey the object code by offering access from a designated
276
+ place (gratis or for a charge), and offer equivalent access to the
277
+ Corresponding Source in the same way through the same place at no
278
+ further charge. You need not require recipients to copy the
279
+ Corresponding Source along with the object code. If the place to
280
+ copy the object code is a network server, the Corresponding Source
281
+ may be on a different server (operated by you or a third party)
282
+ that supports equivalent copying facilities, provided you maintain
283
+ clear directions next to the object code saying where to find the
284
+ Corresponding Source. Regardless of what server hosts the
285
+ Corresponding Source, you remain obligated to ensure that it is
286
+ available for as long as needed to satisfy these requirements.
287
+
288
+ e) Convey the object code using peer-to-peer transmission, provided
289
+ you inform other peers where the object code and Corresponding
290
+ Source of the work are being offered to the general public at no
291
+ charge under subsection 6d.
292
+
293
+ A separable portion of the object code, whose source code is excluded
294
+ from the Corresponding Source as a System Library, need not be
295
+ included in conveying the object code work.
296
+
297
+ A "User Product" is either (1) a "consumer product", which means any
298
+ tangible personal property which is normally used for personal, family,
299
+ or household purposes, or (2) anything designed or sold for incorporation
300
+ into a dwelling. In determining whether a product is a consumer product,
301
+ doubtful cases shall be resolved in favor of coverage. For a particular
302
+ product received by a particular user, "normally used" refers to a
303
+ typical or common use of that class of product, regardless of the status
304
+ of the particular user or of the way in which the particular user
305
+ actually uses, or expects or is expected to use, the product. A product
306
+ is a consumer product regardless of whether the product has substantial
307
+ commercial, industrial or non-consumer uses, unless such uses represent
308
+ the only significant mode of use of the product.
309
+
310
+ "Installation Information" for a User Product means any methods,
311
+ procedures, authorization keys, or other information required to install
312
+ and execute modified versions of a covered work in that User Product from
313
+ a modified version of its Corresponding Source. The information must
314
+ suffice to ensure that the continued functioning of the modified object
315
+ code is in no case prevented or interfered with solely because
316
+ modification has been made.
317
+
318
+ If you convey an object code work under this section in, or with, or
319
+ specifically for use in, a User Product, and the conveying occurs as
320
+ part of a transaction in which the right of possession and use of the
321
+ User Product is transferred to the recipient in perpetuity or for a
322
+ fixed term (regardless of how the transaction is characterized), the
323
+ Corresponding Source conveyed under this section must be accompanied
324
+ by the Installation Information. But this requirement does not apply
325
+ if neither you nor any third party retains the ability to install
326
+ modified object code on the User Product (for example, the work has
327
+ been installed in ROM).
328
+
329
+ The requirement to provide Installation Information does not include a
330
+ requirement to continue to provide support service, warranty, or updates
331
+ for a work that has been modified or installed by the recipient, or for
332
+ the User Product in which it has been modified or installed. Access to a
333
+ network may be denied when the modification itself materially and
334
+ adversely affects the operation of the network or violates the rules and
335
+ protocols for communication across the network.
336
+
337
+ Corresponding Source conveyed, and Installation Information provided,
338
+ in accord with this section must be in a format that is publicly
339
+ documented (and with an implementation available to the public in
340
+ source code form), and must require no special password or key for
341
+ unpacking, reading or copying.
342
+
343
+ 7. Additional Terms.
344
+
345
+ "Additional permissions" are terms that supplement the terms of this
346
+ License by making exceptions from one or more of its conditions.
347
+ Additional permissions that are applicable to the entire Program shall
348
+ be treated as though they were included in this License, to the extent
349
+ that they are valid under applicable law. If additional permissions
350
+ apply only to part of the Program, that part may be used separately
351
+ under those permissions, but the entire Program remains governed by
352
+ this License without regard to the additional permissions.
353
+
354
+ When you convey a copy of a covered work, you may at your option
355
+ remove any additional permissions from that copy, or from any part of
356
+ it. (Additional permissions may be written to require their own
357
+ removal in certain cases when you modify the work.) You may place
358
+ additional permissions on material, added by you to a covered work,
359
+ for which you have or can give appropriate copyright permission.
360
+
361
+ Notwithstanding any other provision of this License, for material you
362
+ add to a covered work, you may (if authorized by the copyright holders of
363
+ that material) supplement the terms of this License with terms:
364
+
365
+ a) Disclaiming warranty or limiting liability differently from the
366
+ terms of sections 15 and 16 of this License; or
367
+
368
+ b) Requiring preservation of specified reasonable legal notices or
369
+ author attributions in that material or in the Appropriate Legal
370
+ Notices displayed by works containing it; or
371
+
372
+ c) Prohibiting misrepresentation of the origin of that material, or
373
+ requiring that modified versions of such material be marked in
374
+ reasonable ways as different from the original version; or
375
+
376
+ d) Limiting the use for publicity purposes of names of licensors or
377
+ authors of the material; or
378
+
379
+ e) Declining to grant rights under trademark law for use of some
380
+ trade names, trademarks, or service marks; or
381
+
382
+ f) Requiring indemnification of licensors and authors of that
383
+ material by anyone who conveys the material (or modified versions of
384
+ it) with contractual assumptions of liability to the recipient, for
385
+ any liability that these contractual assumptions directly impose on
386
+ those licensors and authors.
387
+
388
+ All other non-permissive additional terms are considered "further
389
+ restrictions" within the meaning of section 10. If the Program as you
390
+ received it, or any part of it, contains a notice stating that it is
391
+ governed by this License along with a term that is a further
392
+ restriction, you may remove that term. If a license document contains
393
+ a further restriction but permits relicensing or conveying under this
394
+ License, you may add to a covered work material governed by the terms
395
+ of that license document, provided that the further restriction does
396
+ not survive such relicensing or conveying.
397
+
398
+ If you add terms to a covered work in accord with this section, you
399
+ must place, in the relevant source files, a statement of the
400
+ additional terms that apply to those files, or a notice indicating
401
+ where to find the applicable terms.
402
+
403
+ Additional terms, permissive or non-permissive, may be stated in the
404
+ form of a separately written license, or stated as exceptions;
405
+ the above requirements apply either way.
406
+
407
+ 8. Termination.
408
+
409
+ You may not propagate or modify a covered work except as expressly
410
+ provided under this License. Any attempt otherwise to propagate or
411
+ modify it is void, and will automatically terminate your rights under
412
+ this License (including any patent licenses granted under the third
413
+ paragraph of section 11).
414
+
415
+ However, if you cease all violation of this License, then your
416
+ license from a particular copyright holder is reinstated (a)
417
+ provisionally, unless and until the copyright holder explicitly and
418
+ finally terminates your license, and (b) permanently, if the copyright
419
+ holder fails to notify you of the violation by some reasonable means
420
+ prior to 60 days after the cessation.
421
+
422
+ Moreover, your license from a particular copyright holder is
423
+ reinstated permanently if the copyright holder notifies you of the
424
+ violation by some reasonable means, this is the first time you have
425
+ received notice of violation of this License (for any work) from that
426
+ copyright holder, and you cure the violation prior to 30 days after
427
+ your receipt of the notice.
428
+
429
+ Termination of your rights under this section does not terminate the
430
+ licenses of parties who have received copies or rights from you under
431
+ this License. If your rights have been terminated and not permanently
432
+ reinstated, you do not qualify to receive new licenses for the same
433
+ material under section 10.
434
+
435
+ 9. Acceptance Not Required for Having Copies.
436
+
437
+ You are not required to accept this License in order to receive or
438
+ run a copy of the Program. Ancillary propagation of a covered work
439
+ occurring solely as a consequence of using peer-to-peer transmission
440
+ to receive a copy likewise does not require acceptance. However,
441
+ nothing other than this License grants you permission to propagate or
442
+ modify any covered work. These actions infringe copyright if you do
443
+ not accept this License. Therefore, by modifying or propagating a
444
+ covered work, you indicate your acceptance of this License to do so.
445
+
446
+ 10. Automatic Licensing of Downstream Recipients.
447
+
448
+ Each time you convey a covered work, the recipient automatically
449
+ receives a license from the original licensors, to run, modify and
450
+ propagate that work, subject to this License. You are not responsible
451
+ for enforcing compliance by third parties with this License.
452
+
453
+ An "entity transaction" is a transaction transferring control of an
454
+ organization, or substantially all assets of one, or subdividing an
455
+ organization, or merging organizations. If propagation of a covered
456
+ work results from an entity transaction, each party to that
457
+ transaction who receives a copy of the work also receives whatever
458
+ licenses to the work the party's predecessor in interest had or could
459
+ give under the previous paragraph, plus a right to possession of the
460
+ Corresponding Source of the work from the predecessor in interest, if
461
+ the predecessor has it or can get it with reasonable efforts.
462
+
463
+ You may not impose any further restrictions on the exercise of the
464
+ rights granted or affirmed under this License. For example, you may
465
+ not impose a license fee, royalty, or other charge for exercise of
466
+ rights granted under this License, and you may not initiate litigation
467
+ (including a cross-claim or counterclaim in a lawsuit) alleging that
468
+ any patent claim is infringed by making, using, selling, offering for
469
+ sale, or importing the Program or any portion of it.
470
+
471
+ 11. Patents.
472
+
473
+ A "contributor" is a copyright holder who authorizes use under this
474
+ License of the Program or a work on which the Program is based. The
475
+ work thus licensed is called the contributor's "contributor version".
476
+
477
+ A contributor's "essential patent claims" are all patent claims
478
+ owned or controlled by the contributor, whether already acquired or
479
+ hereafter acquired, that would be infringed by some manner, permitted
480
+ by this License, of making, using, or selling its contributor version,
481
+ but do not include claims that would be infringed only as a
482
+ consequence of further modification of the contributor version. For
483
+ purposes of this definition, "control" includes the right to grant
484
+ patent sublicenses in a manner consistent with the requirements of
485
+ this License.
486
+
487
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
488
+ patent license under the contributor's essential patent claims, to
489
+ make, use, sell, offer for sale, import and otherwise run, modify and
490
+ propagate the contents of its contributor version.
491
+
492
+ In the following three paragraphs, a "patent license" is any express
493
+ agreement or commitment, however denominated, not to enforce a patent
494
+ (such as an express permission to practice a patent or covenant not to
495
+ sue for patent infringement). To "grant" such a patent license to a
496
+ party means to make such an agreement or commitment not to enforce a
497
+ patent against the party.
498
+
499
+ If you convey a covered work, knowingly relying on a patent license,
500
+ and the Corresponding Source of the work is not available for anyone
501
+ to copy, free of charge and under the terms of this License, through a
502
+ publicly available network server or other readily accessible means,
503
+ then you must either (1) cause the Corresponding Source to be so
504
+ available, or (2) arrange to deprive yourself of the benefit of the
505
+ patent license for this particular work, or (3) arrange, in a manner
506
+ consistent with the requirements of this License, to extend the patent
507
+ license to downstream recipients. "Knowingly relying" means you have
508
+ actual knowledge that, but for the patent license, your conveying the
509
+ covered work in a country, or your recipient's use of the covered work
510
+ in a country, would infringe one or more identifiable patents in that
511
+ country that you have reason to believe are valid.
512
+
513
+ If, pursuant to or in connection with a single transaction or
514
+ arrangement, you convey, or propagate by procuring conveyance of, a
515
+ covered work, and grant a patent license to some of the parties
516
+ receiving the covered work authorizing them to use, propagate, modify
517
+ or convey a specific copy of the covered work, then the patent license
518
+ you grant is automatically extended to all recipients of the covered
519
+ work and works based on it.
520
+
521
+ A patent license is "discriminatory" if it does not include within
522
+ the scope of its coverage, prohibits the exercise of, or is
523
+ conditioned on the non-exercise of one or more of the rights that are
524
+ specifically granted under this License. You may not convey a covered
525
+ work if you are a party to an arrangement with a third party that is
526
+ in the business of distributing software, under which you make payment
527
+ to the third party based on the extent of your activity of conveying
528
+ the work, and under which the third party grants, to any of the
529
+ parties who would receive the covered work from you, a discriminatory
530
+ patent license (a) in connection with copies of the covered work
531
+ conveyed by you (or copies made from those copies), or (b) primarily
532
+ for and in connection with specific products or compilations that
533
+ contain the covered work, unless you entered into that arrangement,
534
+ or that patent license was granted, prior to 28 March 2007.
535
+
536
+ Nothing in this License shall be construed as excluding or limiting
537
+ any implied license or other defenses to infringement that may
538
+ otherwise be available to you under applicable patent law.
539
+
540
+ 12. No Surrender of Others' Freedom.
541
+
542
+ If conditions are imposed on you (whether by court order, agreement or
543
+ otherwise) that contradict the conditions of this License, they do not
544
+ excuse you from the conditions of this License. If you cannot convey a
545
+ covered work so as to satisfy simultaneously your obligations under this
546
+ License and any other pertinent obligations, then as a consequence you may
547
+ not convey it at all. For example, if you agree to terms that obligate you
548
+ to collect a royalty for further conveying from those to whom you convey
549
+ the Program, the only way you could satisfy both those terms and this
550
+ License would be to refrain entirely from conveying the Program.
551
+
552
+ 13. Use with the GNU Affero General Public License.
553
+
554
+ Notwithstanding any other provision of this License, you have
555
+ permission to link or combine any covered work with a work licensed
556
+ under version 3 of the GNU Affero General Public License into a single
557
+ combined work, and to convey the resulting work. The terms of this
558
+ License will continue to apply to the part which is the covered work,
559
+ but the special requirements of the GNU Affero General Public License,
560
+ section 13, concerning interaction through a network will apply to the
561
+ combination as such.
562
+
563
+ 14. Revised Versions of this License.
564
+
565
+ The Free Software Foundation may publish revised and/or new versions of
566
+ the GNU General Public License from time to time. Such new versions will
567
+ be similar in spirit to the present version, but may differ in detail to
568
+ address new problems or concerns.
569
+
570
+ Each version is given a distinguishing version number. If the
571
+ Program specifies that a certain numbered version of the GNU General
572
+ Public License "or any later version" applies to it, you have the
573
+ option of following the terms and conditions either of that numbered
574
+ version or of any later version published by the Free Software
575
+ Foundation. If the Program does not specify a version number of the
576
+ GNU General Public License, you may choose any version ever published
577
+ by the Free Software Foundation.
578
+
579
+ If the Program specifies that a proxy can decide which future
580
+ versions of the GNU General Public License can be used, that proxy's
581
+ public statement of acceptance of a version permanently authorizes you
582
+ to choose that version for the Program.
583
+
584
+ Later license versions may give you additional or different
585
+ permissions. However, no additional obligations are imposed on any
586
+ author or copyright holder as a result of your choosing to follow a
587
+ later version.
588
+
589
+ 15. Disclaimer of Warranty.
590
+
591
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592
+ APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593
+ HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594
+ OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595
+ THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596
+ PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597
+ IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598
+ ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599
+
600
+ 16. Limitation of Liability.
601
+
602
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604
+ THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605
+ GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606
+ USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607
+ DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608
+ PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609
+ EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610
+ SUCH DAMAGES.
611
+
612
+ 17. Interpretation of Sections 15 and 16.
613
+
614
+ If the disclaimer of warranty and limitation of liability provided
615
+ above cannot be given local legal effect according to their terms,
616
+ reviewing courts shall apply local law that most closely approximates
617
+ an absolute waiver of all civil liability in connection with the
618
+ Program, unless a warranty or assumption of liability accompanies a
619
+ copy of the Program in return for a fee.
620
+
621
+ END OF TERMS AND CONDITIONS
622
+
623
+ How to Apply These Terms to Your New Programs
624
+
625
+ If you develop a new program, and you want it to be of the greatest
626
+ possible use to the public, the best way to achieve this is to make it
627
+ free software which everyone can redistribute and change under these terms.
628
+
629
+ To do so, attach the following notices to the program. It is safest
630
+ to attach them to the start of each source file to most effectively
631
+ state the exclusion of warranty; and each file should have at least
632
+ the "copyright" line and a pointer to where the full notice is found.
633
+
634
+ {one line to give the program's name and a brief idea of what it does.}
635
+ Copyright (C) {year} {name of author}
636
+
637
+ This program is free software: you can redistribute it and/or modify
638
+ it under the terms of the GNU General Public License as published by
639
+ the Free Software Foundation, either version 3 of the License, or
640
+ (at your option) any later version.
641
+
642
+ This program is distributed in the hope that it will be useful,
643
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
644
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645
+ GNU General Public License for more details.
646
+
647
+ You should have received a copy of the GNU General Public License
648
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
649
+
650
+ Also add information on how to contact you by electronic and paper mail.
651
+
652
+ If the program does terminal interaction, make it output a short
653
+ notice like this when it starts in an interactive mode:
654
+
655
+ {project} Copyright (C) {year} {fullname}
656
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657
+ This is free software, and you are welcome to redistribute it
658
+ under certain conditions; type `show c' for details.
659
+
660
+ The hypothetical commands `show w' and `show c' should show the appropriate
661
+ parts of the General Public License. Of course, your program's commands
662
+ might be different; for a GUI interface, you would use an "about box".
663
+
664
+ You should also get your employer (if you work as a programmer) or school,
665
+ if any, to sign a "copyright disclaimer" for the program, if necessary.
666
+ For more information on this, and how to apply and follow the GNU GPL, see
667
+ <http://www.gnu.org/licenses/>.
668
+
669
+ The GNU General Public License does not permit incorporating your program
670
+ into proprietary programs. If your program is a subroutine library, you
671
+ may consider it more useful to permit linking proprietary applications with
672
+ the library. If this is what you want to do, use the GNU Lesser General
673
+ Public License instead of this License. But first, please read
674
+ <http://www.gnu.org/philosophy/why-not-lgpl.html>.
675
+
vendor/yoast/i18n-module/README.md ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [![Code Climate](https://codeclimate.com/github/Yoast/i18n-module/badges/gpa.svg)](https://codeclimate.com/github/Yoast/i18n-module)
2
+
3
+ # Yoast i18n module
4
+ Promote your own translation site for people who are using your plugin in another language than `en_US`.
5
+
6
+ ## Example of the rendered promo box
7
+ ![Example promo box 1](https://cloud.githubusercontent.com/assets/5147598/17158139/66429a10-5394-11e6-8d6d-5da0e0a5b074.png)
8
+
9
+ ![Example promo box 2](https://cloud.githubusercontent.com/assets/5147598/17158143/6ed2f33c-5394-11e6-825b-a0fc04f2df83.png)
10
+
11
+ The image, the name of your plugin and the name of your translation project are all configurable (see example below). The name of the language is retrieved from your GlotPress install, as is the percentage translated. The box doesn't display when a language has been translated for 90% or more.
12
+
13
+ ## How to use this module
14
+
15
+ Include it in your project using composer:
16
+ ```bash
17
+ composer require yoast/i18n-module
18
+ ```
19
+
20
+ Alternatively you can include the library as a submodule.
21
+ Make sure the class is loaded and instantiate it like this:
22
+
23
+ ```php
24
+ new Yoast_I18n_v3(
25
+ array(
26
+ 'textdomain' => '{your text domain}',
27
+ 'project_slug' => '{your probject slug}',
28
+ 'plugin_name' => '{your plugin name}',
29
+ 'hook' => '{the hook to display the message box on}',
30
+ 'glotpress_url' => '{url to your glotpress installation; http://translate.yoast.com}',
31
+ 'glotpress_name' => '{name of your glotpress installation}',
32
+ 'glotpress_logo' => '{url to a logo which will be shown}',
33
+ 'register_url ' => '{url to use when registering for a project}',
34
+ )
35
+ );
36
+ ```
37
+
38
+ Because translate.wordpress.org is also a GlotPress installation you can use the i18n-module to promote translation your plugin on there. To do this you can use the dedicated wordpress.org class:
39
+
40
+ ```php
41
+ new Yoast_I18n_WordPressOrg_v3(
42
+ array(
43
+ 'textdomain' => '{your text domain}',
44
+ 'plugin_name' => '{your plugin name}',
45
+ 'hook' => '{hook to display the message box on}',
46
+ )
47
+ );
48
+ ```
49
+
50
+ ### Customize where and when to render the message
51
+
52
+ Since 3.0.0 you can also decide to render the message in a message-box of your own, just provide the second argument to the constructor as `false` to disable the showing of the box by the module itself.
53
+
54
+ ```php
55
+ $i18n_module = new Yoast_I18n_v3(
56
+ array(
57
+ 'textdomain' => '{your text domain}',
58
+ 'project_slug' => '{your probject slug}',
59
+ 'plugin_name' => '{your plugin name}',
60
+ 'hook' => '{the hook to display the message on - not used in this example}',
61
+ 'glotpress_url' => '{url to your glotpress installation; http://translate.yoast.com}',
62
+ 'glotpress_name' => '{name of your glotpress installation}',
63
+ 'glotpress_logo' => '{url to a logo which will be shown}',
64
+ 'register_url ' => '{url to use when registering for a project}',
65
+ ),
66
+ false
67
+ );
68
+
69
+ $message = $i18n_module->get_promo_message();
70
+ ```
71
+
72
+ ```php
73
+ $i18n_module = new Yoast_I18n_WordPressOrg_v3(
74
+ array(
75
+ 'textdomain' => '{your text domain}',
76
+ 'plugin_name' => '{your plugin name}',
77
+ 'hook' => '{hook to display the message on - not used in this example}',
78
+ ),
79
+ false
80
+ );
81
+
82
+ $message = $i18n_module->get_promo_message();
83
+ ```
vendor/yoast/i18n-module/composer.json ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name" : "yoast/i18n-module",
3
+ "description": "Handle i18n for WordPress plugins.",
4
+ "keywords" : ["wordpress"],
5
+ "homepage" : "https://github.com/Yoast/i18n-module",
6
+ "license" : "GPL-2.0+",
7
+ "authors" : [
8
+ {
9
+ "name" : "Team Yoast",
10
+ "email" : "support@yoast.com",
11
+ "homepage": "https://yoast.com"
12
+ }
13
+ ],
14
+ "support" : {
15
+ "issues": "https://github.com/Yoast/i18n-module/issues"
16
+ },
17
+ "autoload" : {
18
+ "classmap": ["src/"]
19
+ }
20
+ }
vendor/yoast/i18n-module/src/i18n-module-wordpressorg.php ADDED
@@ -0,0 +1,86 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * The Yoast i18n module with a connection to WordPress.org.
5
+ */
6
+ class Yoast_I18n_WordPressOrg_v3 {
7
+
8
+ /**
9
+ * The i18n object that presents the user with the notification.
10
+ *
11
+ * @var yoast_i18n_v3
12
+ */
13
+ protected $i18n;
14
+
15
+ /**
16
+ * Constructs the i18n module for wordpress.org. Required fields are the 'textdomain', 'plugin_name' and 'hook'
17
+ *
18
+ * @param array $args The settings for the i18n module.
19
+ * @param bool $show_translation_box Whether the translation box should be shown.
20
+ */
21
+ public function __construct( $args, $show_translation_box = true ) {
22
+ $args = $this->set_defaults( $args );
23
+
24
+ $this->i18n = new Yoast_I18n_v3( $args, $show_translation_box );
25
+ $this->set_api_url( $args['textdomain'] );
26
+ }
27
+
28
+ /**
29
+ * Returns the i18n_promo message from the i18n_module. Returns en empty string if the promo shouldn't be shown.
30
+ *
31
+ * @access public
32
+ *
33
+ * @return string The i18n promo message.
34
+ */
35
+ public function get_promo_message() {
36
+ return $this->i18n->get_promo_message();
37
+ }
38
+
39
+ /**
40
+ * Returns a button that can be used to dismiss the i18n-message.
41
+ *
42
+ * @access private
43
+ *
44
+ * @return string
45
+ */
46
+ public function get_dismiss_i18n_message_button() {
47
+ return $this->i18n->get_dismiss_i18n_message_button();
48
+ }
49
+
50
+ /**
51
+ * Sets the default values for wordpress.org
52
+ *
53
+ * @param array $args The arguments to set defaults for.
54
+ *
55
+ * @return array The arguments with the arguments set.
56
+ */
57
+ private function set_defaults( $args ) {
58
+
59
+ if ( ! isset( $args['glotpress_logo'] ) ) {
60
+ $args['glotpress_logo'] = 'https://plugins.svn.wordpress.org/' . $args['textdomain'] . '/assets/icon-128x128.png';
61
+ }
62
+
63
+ if ( ! isset( $args['register_url'] ) ) {
64
+ $args['register_url'] = 'https://translate.wordpress.org/projects/wp-plugins/' . $args['textdomain'] . '/';
65
+ }
66
+
67
+ if ( ! isset( $args['glotpress_name'] ) ) {
68
+ $args['glotpress_name'] = 'Translating WordPress';
69
+ }
70
+
71
+ if ( ! isset( $args['project_slug'] ) ) {
72
+ $args['project_slug'] = $args['textdomain'];
73
+ }
74
+
75
+ return $args;
76
+ }
77
+
78
+ /**
79
+ * Set the API URL on the i18n object.
80
+ *
81
+ * @param string $textdomain The textdomain to use for the API URL.
82
+ */
83
+ private function set_api_url( $textdomain ) {
84
+ $this->i18n->set_api_url( 'https://translate.wordpress.org/api/projects/wp-plugins/' . $textdomain . '/stable/' );
85
+ }
86
+ }
vendor/yoast/i18n-module/src/i18n-module.php ADDED
@@ -0,0 +1,388 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * This class defines a promo box and checks your translation site's API for stats about it, then shows them to the user.
5
+ */
6
+ class Yoast_I18n_v3 {
7
+
8
+ /**
9
+ * Your translation site's logo
10
+ *
11
+ * @var string
12
+ */
13
+ private $glotpress_logo;
14
+
15
+ /**
16
+ * Your translation site's name
17
+ *
18
+ * @var string
19
+ */
20
+ private $glotpress_name;
21
+
22
+ /**
23
+ * Your translation site's URL
24
+ *
25
+ * @var string
26
+ */
27
+ private $glotpress_url;
28
+
29
+ /**
30
+ * The URL to actually do the API request to
31
+ *
32
+ * @var string
33
+ */
34
+ private $api_url;
35
+
36
+ /**
37
+ * Hook where you want to show the promo box
38
+ *
39
+ * @var string
40
+ */
41
+ private $hook;
42
+
43
+ /**
44
+ * Will contain the site's locale
45
+ *
46
+ * @access private
47
+ * @var string
48
+ */
49
+ private $locale;
50
+
51
+ /**
52
+ * Will contain the locale's name, obtained from your translation site
53
+ *
54
+ * @access private
55
+ * @var string
56
+ */
57
+ private $locale_name;
58
+
59
+ /**
60
+ * Will contain the percentage translated for the plugin translation project in the locale
61
+ *
62
+ * @access private
63
+ * @var int
64
+ */
65
+ private $percent_translated;
66
+
67
+ /**
68
+ * Name of your plugin
69
+ *
70
+ * @var string
71
+ */
72
+ private $plugin_name;
73
+
74
+ /**
75
+ * Project slug for the project on your translation site
76
+ *
77
+ * @var string
78
+ */
79
+ private $project_slug;
80
+
81
+ /**
82
+ * URL to point to for registration links
83
+ *
84
+ * @var string
85
+ */
86
+ private $register_url;
87
+
88
+ /**
89
+ * Your plugins textdomain
90
+ *
91
+ * @var string
92
+ */
93
+ private $textdomain;
94
+
95
+ /**
96
+ * Indicates whether there's a translation available at all.
97
+ *
98
+ * @access private
99
+ * @var bool
100
+ */
101
+ private $translation_exists;
102
+
103
+ /**
104
+ * Indicates whether the translation's loaded.
105
+ *
106
+ * @access private
107
+ * @var bool
108
+ */
109
+ private $translation_loaded;
110
+
111
+ /**
112
+ * Class constructor
113
+ *
114
+ * @param array $args Contains the settings for the class.
115
+ * @param bool $show_translation_box Whether the translation box should be shown.
116
+ */
117
+ public function __construct( $args, $show_translation_box = true ) {
118
+ if ( ! is_admin() ) {
119
+ return;
120
+ }
121
+
122
+ $this->locale = $this->get_admin_locale();
123
+
124
+ if ( $this->is_default_language( $this->locale ) ) {
125
+ return;
126
+ }
127
+
128
+ $this->init( $args );
129
+
130
+ if ( $show_translation_box ) {
131
+ add_action( $this->hook, array( $this, 'promo' ) );
132
+ }
133
+ }
134
+
135
+ /**
136
+ * Returns whether the language is en_US.
137
+ *
138
+ * @param string $language The language to check.
139
+ *
140
+ * @return bool Returns true if the language is en_US.
141
+ */
142
+ protected function is_default_language( $language ) {
143
+ return 'en_US' === $language;
144
+ }
145
+
146
+ /**
147
+ * Returns the locale used in the admin.
148
+ *
149
+ * WordPress 4.7 introduced the ability for users to specify an Admin language
150
+ * different from the language used on the front end. This checks if the feature
151
+ * is available and returns the user's language, with a fallback to the site's language.
152
+ * Can be removed when support for WordPress 4.6 will be dropped, in favor
153
+ * of WordPress get_user_locale() that already fallbacks to the site’s locale.
154
+ *
155
+ * @returns string The locale.
156
+ */
157
+ private function get_admin_locale() {
158
+ if ( function_exists( 'get_user_locale' ) ) {
159
+ return get_user_locale();
160
+ }
161
+
162
+ return get_locale();
163
+ }
164
+
165
+ /**
166
+ * This is where you decide where to display the messages and where you set the plugin specific variables.
167
+ *
168
+ * @access private
169
+ *
170
+ * @param array $args
171
+ */
172
+ private function init( $args ) {
173
+ foreach ( $args as $key => $arg ) {
174
+ $this->$key = $arg;
175
+ }
176
+ }
177
+
178
+ /**
179
+ * Check whether the promo should be hidden or not
180
+ *
181
+ * @access private
182
+ *
183
+ * @return bool
184
+ */
185
+ private function hide_promo() {
186
+ $hide_promo = get_transient( 'yoast_i18n_' . $this->project_slug . '_promo_hide' );
187
+ if ( ! $hide_promo ) {
188
+ if ( filter_input( INPUT_GET, 'remove_i18n_promo', FILTER_VALIDATE_INT ) === 1 ) {
189
+ // No expiration time, so this would normally not expire, but it wouldn't be copied to other sites etc.
190
+ set_transient( 'yoast_i18n_' . $this->project_slug . '_promo_hide', true );
191
+ $hide_promo = true;
192
+ }
193
+ }
194
+ return $hide_promo;
195
+ }
196
+
197
+ /**
198
+ * Returns the i18n_promo message from the i18n_module. Returns en empty string if the promo shouldn't be shown.
199
+ *
200
+ * @access public
201
+ *
202
+ * @return string The i18n promo message.
203
+ */
204
+ public function get_promo_message() {
205
+ if ( ! $this->is_default_language( $this->locale ) && ! $this->hide_promo() ) {
206
+ return $this->promo_message();
207
+ }
208
+
209
+ return '';
210
+ }
211
+
212
+ /**
213
+ * Generates a promo message
214
+ *
215
+ * @access private
216
+ *
217
+ * @return bool|string $message
218
+ */
219
+ private function promo_message() {
220
+
221
+ $this->translation_details();
222
+
223
+ $message = false;
224
+
225
+ if ( $this->translation_exists && $this->translation_loaded && $this->percent_translated < 90 ) {
226
+ $message = __( 'As you can see, there is a translation of this plugin in %1$s. This translation is currently %3$d%% complete. We need your help to make it complete and to fix any errors. Please register at %4$s to help complete the translation to %1$s!', $this->textdomain );
227
+ } else if ( ! $this->translation_loaded && $this->translation_exists ) {
228
+ $message = __( 'You\'re using WordPress in %1$s. While %2$s has been translated to %1$s for %3$d%%, it\'s not been shipped with the plugin yet. You can help! Register at %4$s to help complete the translation to %1$s!', $this->textdomain );
229
+ } else if ( ! $this->translation_exists ) {
230
+ $message = __( 'You\'re using WordPress in a language we don\'t support yet. We\'d love for %2$s to be translated in that language too, but unfortunately, it isn\'t right now. You can change that! Register at %4$s to help translate it!', $this->textdomain );
231
+ }
232
+
233
+ $registration_link = sprintf( '<a href="%1$s">%2$s</a>', esc_url( $this->register_url ), esc_html( $this->glotpress_name ) );
234
+ $message = sprintf( $message, esc_html( $this->locale_name ), esc_html( $this->plugin_name ), $this->percent_translated, $registration_link );
235
+
236
+ if ( $message ) {
237
+ $message = '<p>' . $message . '</p>' . '<p><a href="' . esc_url( $this->register_url ) . '">' . __( 'Register now &raquo;', $this->textdomain ) . '</a></p>';
238
+ }
239
+
240
+ return $message;
241
+ }
242
+
243
+ /**
244
+ * Returns a button that can be used to dismiss the i18n-message.
245
+ *
246
+ * @access private
247
+ *
248
+ * @return string
249
+ */
250
+ public function get_dismiss_i18n_message_button() {
251
+ return sprintf(
252
+ /* translators: %1$s is the notification dismissal link start tag, %2$s is the link closing tag. */
253
+ __( '%1$sPlease don\'t show me this notification anymore%2$s', $this->textdomain ),
254
+ '<a class="button" href="' . esc_url( add_query_arg( array( 'remove_i18n_promo' => '1' ) ) ) . '">',
255
+ '</a>'
256
+ );
257
+ }
258
+
259
+ /**
260
+ * Outputs a promo box.
261
+ *
262
+ * @access public
263
+ */
264
+ public function promo() {
265
+ $message = $this->get_promo_message();
266
+
267
+ if ( $message ) {
268
+ echo '<div id="i18n_promo_box" style="border:1px solid #ccc;background-color:#fff;padding:10px;max-width:650px; overflow: hidden;">';
269
+ echo '<a href="' . esc_url( add_query_arg( array( 'remove_i18n_promo' => '1' ) ) ) . '" style="color:#333;text-decoration:none;font-weight:bold;font-size:16px;border:1px solid #ccc;padding:1px 4px;" class="alignright">X</a>';
270
+
271
+ echo '<div>';
272
+ echo '<h2>' . sprintf( __( 'Translation of %s', $this->textdomain ), $this->plugin_name ) . '</h2>';
273
+ if ( isset( $this->glotpress_logo ) && '' != $this->glotpress_logo ) {
274
+ echo '<a href="' . esc_url( $this->register_url ) . '"><img class="alignright" style="margin:0 5px 5px 5px;max-width:200px;" src="' . esc_url( $this->glotpress_logo ) . '" alt="' . esc_attr( $this->glotpress_name ) . '"/></a>';
275
+ }
276
+ echo $message;
277
+ echo '</div>';
278
+ echo '</div>';
279
+ }
280
+ }
281
+
282
+ /**
283
+ * Try to find the transient for the translation set or retrieve them.
284
+ *
285
+ * @access private
286
+ *
287
+ * @return object|null
288
+ */
289
+ private function find_or_initialize_translation_details() {
290
+ $set = get_transient( 'yoast_i18n_' . $this->project_slug . '_' . $this->locale );
291
+
292
+ if ( ! $set ) {
293
+ $set = $this->retrieve_translation_details();
294
+ set_transient( 'yoast_i18n_' . $this->project_slug . '_' . $this->locale, $set, DAY_IN_SECONDS );
295
+ }
296
+
297
+ return $set;
298
+ }
299
+
300
+ /**
301
+ * Try to get translation details from cache, otherwise retrieve them, then parse them.
302
+ *
303
+ * @access private
304
+ */
305
+ private function translation_details() {
306
+ $set = $this->find_or_initialize_translation_details();
307
+
308
+ $this->translation_exists = ! is_null( $set );
309
+ $this->translation_loaded = is_textdomain_loaded( $this->textdomain );
310
+
311
+ $this->parse_translation_set( $set );
312
+ }
313
+
314
+ /**
315
+ * The API URL to use when requesting translation information.
316
+ *
317
+ * @param string $api_url The new API URL.
318
+ */
319
+ public function set_api_url( $api_url ) {
320
+ $this->api_url = $api_url;
321
+ }
322
+
323
+ /**
324
+ * Returns the API URL to use when requesting translation information.
325
+ *
326
+ * @return string
327
+ */
328
+ private function get_api_url() {
329
+ if ( empty( $this->api_url ) ) {
330
+ $this->api_url = trailingslashit( $this->glotpress_url ) . 'api/projects/' . $this->project_slug;
331
+ }
332
+
333
+ return $this->api_url;
334
+ }
335
+
336
+ /**
337
+ * Retrieve the translation details from Yoast Translate
338
+ *
339
+ * @access private
340
+ *
341
+ * @return object|null
342
+ */
343
+ private function retrieve_translation_details() {
344
+ $api_url = $this->get_api_url();
345
+
346
+ $resp = wp_remote_get( $api_url );
347
+ if ( is_wp_error( $resp ) || wp_remote_retrieve_response_code( $resp ) !== 200 ) {
348
+ return null;
349
+ }
350
+ $body = wp_remote_retrieve_body( $resp );
351
+ unset( $resp );
352
+
353
+ if ( $body ) {
354
+ $body = json_decode( $body );
355
+ if ( empty( $body->translation_sets ) ) {
356
+ return null;
357
+ }
358
+ foreach ( $body->translation_sets as $set ) {
359
+ if ( ! property_exists( $set, 'wp_locale' ) ) {
360
+ continue;
361
+ }
362
+
363
+ if ( $this->locale === $set->wp_locale ) {
364
+ return $set;
365
+ }
366
+ }
367
+ }
368
+
369
+ return null;
370
+ }
371
+
372
+ /**
373
+ * Set the needed private variables based on the results from Yoast Translate
374
+ *
375
+ * @param object $set The translation set
376
+ *
377
+ * @access private
378
+ */
379
+ private function parse_translation_set( $set ) {
380
+ if ( $this->translation_exists && is_object( $set ) ) {
381
+ $this->locale_name = $set->name;
382
+ $this->percent_translated = $set->percent_translated;
383
+ } else {
384
+ $this->locale_name = '';
385
+ $this->percent_translated = '';
386
+ }
387
+ }
388
+ }