Insert Post Ads - Version 1.1.1

Version Description

  • Code cleanups
  • Permissions for ads access
Download this release

Release Info

Developer deb255
Plugin Icon 128x128 Insert Post Ads
Version 1.1.1
Comparing to
See all releases

Code changes from version 1.1 to 1.1.1

insert-post-ads.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Plugin Name: Insert Post Ads
4
  * Plugin URI: http://www.wpbeginner.com/
5
- * Version: 1.1
6
  * Author: WPBeginner
7
  * Author URI: http://www.wpbeginner.com/
8
  * Description: Allows you to insert ads after paragraphs of your post content
@@ -39,7 +39,7 @@ class InsertPostAds {
39
  $this->plugin->name = 'insert-post-ads'; // Plugin Folder
40
  $this->plugin->displayName = 'Post Adverts'; // Plugin Name
41
  $this->plugin->posttype = 'insertpostads';
42
- $this->plugin->version = '1.1';
43
  $this->plugin->folder = plugin_dir_path( __FILE__ );
44
  $this->plugin->url = plugin_dir_url( __FILE__ );
45
  $this->plugin->ads_screen_key = $this->plugin->name . '-ads-display-chosen-once';
@@ -100,13 +100,13 @@ class InsertPostAds {
100
  'show_in_nav_menus' => false,
101
  'supports' => array( 'title' ),
102
  'capabilities' => array(
103
- 'edit_post' => 'update_core',
104
- 'delete_post' => 'update_core',
105
- 'edit_posts' => 'update_core',
106
- 'edit_others_posts' => 'update_core',
107
- 'delete_posts' => 'update_core',
108
- 'publish_posts' => 'update_core',
109
- 'read_private_posts' => 'update_core'
110
  ),
111
  ));
112
  }
@@ -499,5 +499,4 @@ class InsertPostAds {
499
  }
500
  }
501
 
502
- $insertPostAds = new InsertPostAds();
503
- ?>
2
  /**
3
  * Plugin Name: Insert Post Ads
4
  * Plugin URI: http://www.wpbeginner.com/
5
+ * Version: 1.1.1
6
  * Author: WPBeginner
7
  * Author URI: http://www.wpbeginner.com/
8
  * Description: Allows you to insert ads after paragraphs of your post content
39
  $this->plugin->name = 'insert-post-ads'; // Plugin Folder
40
  $this->plugin->displayName = 'Post Adverts'; // Plugin Name
41
  $this->plugin->posttype = 'insertpostads';
42
+ $this->plugin->version = '1.1.1';
43
  $this->plugin->folder = plugin_dir_path( __FILE__ );
44
  $this->plugin->url = plugin_dir_url( __FILE__ );
45
  $this->plugin->ads_screen_key = $this->plugin->name . '-ads-display-chosen-once';
100
  'show_in_nav_menus' => false,
101
  'supports' => array( 'title' ),
102
  'capabilities' => array(
103
+ 'edit_post' => 'manage_options',
104
+ 'delete_post' => 'manage_options',
105
+ 'edit_posts' => 'manage_options',
106
+ 'edit_others_posts' => 'manage_options',
107
+ 'delete_posts' => 'manage_options',
108
+ 'publish_posts' => 'manage_options',
109
+ 'read_private_posts' => 'manage_options'
110
  ),
111
  ));
112
  }
499
  }
500
  }
501
 
502
+ $insertPostAds = new InsertPostAds();
 
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: WPbeginner, smub, deb255
3
  Donate link:http://www.wpbeginner.com/wpbeginner-needs-your-help/
4
  Tags: ad injection, ads, ads plugin, adsense, adsense injection, google adsense, insert ads in post, insert post ads, wordpress ads plugin, advertising plugin, banners plugin, post ads
5
  Requires at least: 3.6
6
- Tested up to: 4.7.2
7
- Stable tag: trunk
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -90,6 +90,10 @@ Syed Balkhi
90
 
91
  == Changelog ==
92
 
 
 
 
 
93
  = 1.1 =
94
  * Tested with WordPress 4.7.3
95
  * Cleaned up code
3
  Donate link:http://www.wpbeginner.com/wpbeginner-needs-your-help/
4
  Tags: ad injection, ads, ads plugin, adsense, adsense injection, google adsense, insert ads in post, insert post ads, wordpress ads plugin, advertising plugin, banners plugin, post ads
5
  Requires at least: 3.6
6
+ Tested up to: 4.8
7
+ Stable tag: 1.1.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
90
 
91
  == Changelog ==
92
 
93
+ = 1.1.1 =
94
+ * Code cleanups
95
+ * Permissions for ads access
96
+
97
  = 1.1 =
98
  * Tested with WordPress 4.7.3
99
  * Cleaned up code
views/dashboard-notices.php CHANGED
@@ -3,19 +3,19 @@
3
  * Notices template
4
  */
5
  ?>
6
- <div class="notice notice-success is-dismissible <?= $this->plugin->name ?>-notice-welcome">
7
- <p><?php _e( 'Thank you for installing Insert Ads!', $this->plugin->name ); ?> <a href="<?= esc_url( admin_url( 'post-new.php?post_type=' . $this->plugin->posttype ) ); ?>">Create</a> your first Advert now.</p>
8
  </div>
9
  <script type="text/javascript">
10
  jQuery(document).ready( function($) {
11
- $(document).on('click', '.<?= $this->plugin->name ?>-notice-welcome button.notice-dismiss', function( event ) {
12
  event.preventDefault();
13
  $.post( ajaxurl, {
14
- action: '<?= $this->plugin->name . '_dismiss_dashboard_notices' ?>',
15
- nonce: '<?= wp_create_nonce( $this->plugin->name . '-nonce' ) ?>'
16
 
17
  });
18
- $('.<?= $this->plugin->name ?>-notice-welcome').remove();
19
  });
20
  });
21
  </script>
3
  * Notices template
4
  */
5
  ?>
6
+ <div class="notice notice-success is-dismissible <?php echo $this->plugin->name; ?>-notice-welcome">
7
+ <p><?php _e( 'Thank you for installing Insert Ads!', $this->plugin->name ); ?> <a href="<?php echo esc_url( admin_url( 'post-new.php?post_type=' . $this->plugin->posttype ) ); ?>">Create</a> your first Advert now.</p>
8
  </div>
9
  <script type="text/javascript">
10
  jQuery(document).ready( function($) {
11
+ $(document).on('click', '.<?php echo $this->plugin->name; ?>-notice-welcome button.notice-dismiss', function( event ) {
12
  event.preventDefault();
13
  $.post( ajaxurl, {
14
+ action: '<?php echo $this->plugin->name . '_dismiss_dashboard_notices'; ?>',
15
+ nonce: '<?php echo wp_create_nonce( $this->plugin->name . '-nonce' ); ?>'
16
 
17
  });
18
+ $('.<?php echo $this->plugin->name; ?>-notice-welcome').remove();
19
  });
20
  });
21
  </script>
views/settings.php CHANGED
@@ -68,7 +68,7 @@
68
  </div>
69
  </div>
70
  <!-- /postbox -->
71
- <input type="hidden" name="_nonce" value= "<?= wp_create_nonce( $this->plugin->name . '-nonce' ); ?>" />
72
  </form>
73
  <!-- /postbox -->
74
  </div>
68
  </div>
69
  </div>
70
  <!-- /postbox -->
71
+ <input type="hidden" name="_nonce" value= "<?php echo wp_create_nonce( $this->plugin->name . '-nonce' ); ?>" />
72
  </form>
73
  <!-- /postbox -->
74
  </div>