Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
contactashish13 committed Oct 12, 2018
2 parents d9892df + 9399892 commit e7f6184
Show file tree
Hide file tree
Showing 27 changed files with 2,630 additions and 1,116 deletions.
4 changes: 4 additions & 0 deletions .travis.yml
Expand Up @@ -22,6 +22,10 @@ matrix:
- env: WP_MULTISITE=1
allow_failures:
- env: WP_MULTISITE=1
- php: 5.3
dist: precise
- php: 5.2
dist: precise

notifications:
email:
Expand Down
51 changes: 32 additions & 19 deletions admin/aioseop_module_class.php
Expand Up @@ -622,7 +622,6 @@ function default_bad_bots() {
'Python-urllib',
'QueryN Metasearch',
'RepoMonkey',
'SemrushBot',
'SISTRIX',
'sitecheck.Internetseer.com',
'SiteSnagger',
Expand Down Expand Up @@ -673,7 +672,6 @@ function default_bad_bots() {
'Incutio',
'lmspider',
'memoryBot',
'SemrushBot',
'serf',
'Unknown',
'uptime files',
Expand Down Expand Up @@ -2021,12 +2019,7 @@ function add_menu( $parent_slug ) {
add_action( "load-{$hookname}", array( $this, 'add_page_hooks' ) );
} elseif ( $v['type'] === 'metabox' ) {
$this->setting_options( $k ); // hack -- make sure this runs anyhow, for now -- pdb
add_action( 'edit_post', array( $this, 'save_post_data' ) );
add_action( 'publish_post', array( $this, 'save_post_data' ) );
add_action( 'add_attachment', array( $this, 'save_post_data' ) );
add_action( 'edit_attachment', array( $this, 'save_post_data' ) );
add_action( 'save_post', array( $this, 'save_post_data' ) );
add_action( 'edit_page_form', array( $this, 'save_post_data' ) );
$this->toggle_save_post_hooks( true );
if ( isset( $v['display'] ) && ! empty( $v['display'] ) ) {
add_action( 'admin_print_scripts', array( $this, 'enqueue_metabox_scripts' ), 5 );
if ( $this->tabbed_metaboxes ) {
Expand Down Expand Up @@ -2086,37 +2079,55 @@ function add_menu( $parent_slug ) {
}
}

/**
* Adds or removes hooks that could be called while editing a post.
*
* TODO: Review if all these hooks are really required (save_post should be enough vs. edit_post and publish_post).
*/
private function toggle_save_post_hooks( $add ) {
if ( $add ) {
add_action( 'edit_post', array( $this, 'save_post_data' ) );
add_action( 'publish_post', array( $this, 'save_post_data' ) );
add_action( 'add_attachment', array( $this, 'save_post_data' ) );
add_action( 'edit_attachment', array( $this, 'save_post_data' ) );
add_action( 'save_post', array( $this, 'save_post_data' ) );
add_action( 'edit_page_form', array( $this, 'save_post_data' ) );
} else {
remove_action( 'edit_post', array( $this, 'save_post_data' ) );
remove_action( 'publish_post', array( $this, 'save_post_data' ) );
remove_action( 'add_attachment', array( $this, 'save_post_data' ) );
remove_action( 'edit_attachment', array( $this, 'save_post_data' ) );
remove_action( 'save_post', array( $this, 'save_post_data' ) );
remove_action( 'edit_page_form', array( $this, 'save_post_data' ) );
}
}

/**
* Update postmeta for metabox.
*
* @param $post_id
*/
function save_post_data( $post_id ) {
static $update = false;
if ( $update ) {
return;
}
$this->toggle_save_post_hooks( false );
if ( $this->locations !== null ) {
foreach ( $this->locations as $k => $v ) {
if ( isset( $v['type'] ) && ( $v['type'] === 'metabox' ) ) {
$opts = $this->default_options( $k );
$options = array();
$update = false;
foreach ( $opts as $l => $o ) {
if ( isset( $_POST[ $l ] ) ) {
$options[ $l ] = stripslashes_deep( $_POST[ $l ] );
$options[ $l ] = esc_attr( $options[ $l ] );
$update = true;
}
}
if ( $update ) {
$prefix = $this->get_prefix( $k );
$options = apply_filters( $prefix . 'filter_metabox_options', $options, $k, $post_id );
update_post_meta( $post_id, '_' . $prefix . $k, $options );
}
$prefix = $this->get_prefix( $k );
$options = apply_filters( $prefix . 'filter_metabox_options', $options, $k, $post_id );
update_post_meta( $post_id, '_' . $prefix . $k, $options );
}
}
}

$this->toggle_save_post_hooks( true );
}

/**
Expand Down Expand Up @@ -2507,6 +2518,8 @@ function sanitize_options( $location = null ) {
case 'filename':
$this->options[ $k ] = sanitize_file_name( $this->options[ $k ] );
break;
case 'url':
// fall through.
case 'text':
$this->options[ $k ] = wp_kses_post( $this->options[ $k ] );
// fall through.
Expand Down
38 changes: 37 additions & 1 deletion admin/display/credits-content.php
Expand Up @@ -55,13 +55,49 @@
Alejandro Mostajo</a>
</li>
<li class="wp-person" id="rozroz">
<a class="web" target="_blank" href="https://profiles.wordpress.org/rozroz/"><img alt="" class="gravatar" src="https://secure.gravatar.com/avatar/5a4758faa5ba6fc1322bdfb0f6ebcf56c?s=60">
<a class="web" target="_blank" href="https://github.com/contactashish13"><img alt="" class="gravatar" src="https://avatars2.githubusercontent.com/u/12953439?s=60">
Ashish Ravi</a>
</li>
<li class="wp-person" id="rozroz">
<a class="web" target="_blank" href="https://profiles.wordpress.org/yummy-wp/"><img alt="" class="gravatar" src="https://avatars0.githubusercontent.com/u/22232968?v=3&s=460">
Stanislav Samoilenko</a>
</li>
<li class="wp-person" id="shoheitanaka">
<a class="web" target="_blank" href="https://profiles.wordpress.org/shoheitanaka"><img alt="" class="gravatar" src="https://secure.gravatar.com/avatar/677e512c803c40c0180d4514f876a21f?s=200&d=mm&r=g">
Shohei Tanaka</a>
</li>
<li class="wp-person" id="EkoJR">
<a class="web" target="_blank" href="https://profiles.wordpress.org/EkoJR/"><img alt="" class="gravatar" src="https://secure.gravatar.com/avatar/bb4c78fe944b58bd5f127d836500c30a?s=200&d=mm&r=g">
Stanislav Samoilenko</a>
</li>
<li class="wp-person" id="webaware">
<a class="web" target="_blank" href="https://profiles.wordpress.org/webaware/"><img alt="" class="gravatar" src="https://secure.gravatar.com/avatar/aee800bc3644d9ebfa33c1ed9df5d958?s=200&d=mm&r=g">
Ross McKay</a>
</li>
<li class="wp-person" id="adamsilverstein">
<a class="web" target="_blank" href="https://profiles.wordpress.org/adamsilverstein/"><img alt=""
class="gravatar"
src="https://secure.gravatar.com/avatar/fddbd6c3e1c3d971aa732b9346aeb433?s=200&d=mm&r=g">
Adam Silverstein</a>
</li>
<li class="wp-person" id="vschettino">
<a class="web" target="_blank" href="https://github.com/vschettino/"><img alt=""
class="gravatar"
src="https://avatars2.githubusercontent.com/u/7289698?s=460&v=4">
Vinicius Schettino</a>
</li>
<li class="wp-person" id="vschettino">
<a class="web" target="_blank" href="https://github.com/srdjan-jcc"><img alt=""
class="gravatar"
src="https://avatars2.githubusercontent.com/u/3109112?s=460&v=4">
Srdjan Jocic</a>
</li>
<li class="wp-person" id="vschettino">
<a class="web" target="_blank" href="https://profiles.wordpress.org/soulseekah/"><img alt=""
class="gravatar"
src="https://avatars0.githubusercontent.com/u/685880?s=460&v=4">
Gennady Kovshenin</a>
</li>
</ul>

<h3 class="wp-people-group dashicons-before dashicons-translation"><?php printf( _e( 'Translation contributors and translation editors', 'all-in-one-seo-pack' ), '1.2' ); ?></h3>
Expand Down
23 changes: 13 additions & 10 deletions admin/display/dashboard_widget.php
Expand Up @@ -15,21 +15,18 @@ class aioseop_dashboard_widget {
* Add the action to the constructor.
*/
function __construct() {
add_action( 'wp_dashboard_setup', array( $this, 'aioseop_add_dashboard_widget' ) );
add_action( 'wp_dashboard_setup', array( $this, 'add_dashboard_widget' ) );
}

/**
* @since 2.3.10
*/
function aioseop_add_dashboard_widget() {

function add_dashboard_widget() {
if ( current_user_can( 'install_plugins' ) && false !== $this->show_widget() ) {
wp_add_dashboard_widget(
'semperplugins-rss-feed', __( 'SEO News', 'all-in-one-seo-pack' ), array(
$this,
'aioseop_display_rss_dashboard_widget',
)
);
wp_add_dashboard_widget( 'semperplugins-rss-feed', __( 'SEO News', 'all-in-one-seo-pack' ), array(
$this,
'display_rss_dashboard_widget',
) );
}

}
Expand Down Expand Up @@ -58,7 +55,13 @@ function show_widget() {
/**
* @since 2.3.10
*/
function aioseop_display_rss_dashboard_widget() {
function display_rss_dashboard_widget() {
// check if the user has chosen not to display this widget through screen options.
$current_screen = get_current_screen();
$hidden_widgets = get_user_meta( get_current_user_id(), 'metaboxhidden_' . $current_screen->id );
if ( $hidden_widgets && count( $hidden_widgets ) > 0 && is_array( $hidden_widgets[0] ) && in_array( 'semperplugins-rss-feed', $hidden_widgets[0], true ) ) {
return;
}

include_once( ABSPATH . WPINC . '/feed.php' );

Expand Down
40 changes: 26 additions & 14 deletions admin/display/welcome-content.php
@@ -1,16 +1,16 @@
<div id="welcome-panel" class="">
<div class="welcome-panel">
<div class="welcome-panel-content">
<div class="welcome-panel-column-container">
<div class="welcome-panel-column">
<h3><?php echo esc_html( __( 'Support All in One SEO Pack', 'all-in-one-seo-pack' ) ); ?></h3>
<p class="message"><?php echo esc_html( __( 'There are many ways you can help support All in One SEO Pack.', 'all-in-one-seo-pack' ) ); ?></p>
<p class="message aioseop-message"><?php echo esc_html( __( 'Upgrade to All in One SEO Pack Pro to access priority support and premium features.', 'all-in-one-seo-pack' ) ); ?></p>
<p class="message welcome-icon welcome-edit-page"><?php echo esc_html( __( 'There are many ways you can help support All in One SEO Pack.', 'all-in-one-seo-pack' ) ); ?></p>
<p class="message aioseop-message welcome-icon welcome-edit-page"><?php echo esc_html( __( 'Upgrade to All in One SEO Pack Pro to access priority support and premium features.', 'all-in-one-seo-pack' ) ); ?></p>
<p class="call-to-action"><a
href="https://semperplugins.com/all-in-one-seo-pack-pro-version/?loc=aio_welcome"
target="_blank"
class="button button-primary button-orange"><?php echo __( 'Upgrade', 'all-in-one-seo-pack' ); ?></a>
</p>
<p class="message aioseop-message"><?php echo esc_html( __( 'Help translate All in One SEO Pack into your language.', 'all-in-one-seo-pack' ) ); ?></p>
<p class="message aioseop-message welcome-icon welcome-edit-page"><?php echo esc_html( __( 'Help translate All in One SEO Pack into your language.', 'all-in-one-seo-pack' ) ); ?></p>
<p class="call-to-action"><a
href="https://translate.wordpress.org/projects/wp-plugins/all-in-one-seo-pack"
class="button button-primary"
Expand All @@ -21,26 +21,34 @@ class="button button-primary"
<h3><?php echo esc_html( __( 'Get Started', 'all-in-one-seo-pack' ) ); ?></h3>
<ul>
<li><a href="https://semperplugins.com/documentation/quick-start-guide/"
target="_blank"><?php echo __( 'Beginners Guide for All in One SEO Pack', 'all-in-one-seo-pack' ); ?></a>
target="_blank"
class="welcome-icon welcome-add-page"><?php echo __( 'Beginners Guide for All in One SEO Pack', 'all-in-one-seo-pack' ); ?></a>

</li>
<li><a href="https://semperplugins.com/documentation/beginners-guide-to-xml-sitemaps/"
target="_blank"><?php echo __( 'Beginners Guide for XML Sitemap module', 'all-in-one-seo-pack' ); ?></a>
target="_blank"
class="welcome-icon welcome-add-page"><?php echo __( 'Beginners Guide for XML Sitemap module', 'all-in-one-seo-pack' ); ?></a>
</li>
<li><a href="https://semperplugins.com/documentation/beginners-guide-to-social-meta/"
target="_blank"><?php echo __( 'Beginners Guide for Social Meta module', 'all-in-one-seo-pack' ); ?></a>
target="_blank"
class="welcome-icon welcome-add-page"><?php echo __( 'Beginners Guide for Social Meta module', 'all-in-one-seo-pack' ); ?></a>
</li>
<li><a href="https://semperplugins.com/documentation/top-tips-for-good-on-page-seo/"
target="_blank"><?php echo __( 'Tips for good on-page SEO', 'all-in-one-seo-pack' ); ?></a>
target="_blank"
class="welcome-icon welcome-add-page"><?php echo __( 'Tips for good on-page SEO', 'all-in-one-seo-pack' ); ?></a>
</li>
<li>
<a href="https://semperplugins.com/documentation/quality-guidelines-for-seo-titles-and-descriptions/"
target="_blank"><?php echo __( 'Quality guidelines for SEO titles and descriptions', 'all-in-one-seo-pack' ); ?></a>
target="_blank"
class="welcome-icon welcome-add-page"><?php echo __( 'Quality guidelines for SEO titles and descriptions', 'all-in-one-seo-pack' ); ?></a>
</li>
<li><a href="https://semperplugins.com/documentation/submitting-an-xml-sitemap-to-google/"
target="_blank"><?php echo __( 'Submit an XML Sitemap to Google', 'all-in-one-seo-pack' ); ?></a>
target="_blank"
class="welcome-icon welcome-add-page"><?php echo __( 'Submit an XML Sitemap to Google', 'all-in-one-seo-pack' ); ?></a>
</li>
<li><a href="https://semperplugins.com/documentation/setting-up-google-analytics/"
target="_blank"><?php echo __( 'Set up Google Analytics', 'all-in-one-seo-pack' ); ?></a>
target="_blank"
class="welcome-icon welcome-add-page"><?php echo __( 'Set up Google Analytics', 'all-in-one-seo-pack' ); ?></a>
</li>
</ul>
</div>
Expand All @@ -49,13 +57,17 @@ class="button button-primary"
<h3><?php echo esc_html( __( 'Did You Know?', 'all-in-one-seo-pack' ) ); ?></h3>
<ul>
<li><a href="https://semperplugins.com/documentation/"
target="_blank"><?php echo __( 'We have complete documentation on every setting and feature', 'all-in-one-seo-pack' ); ?></a>
target="_blank"
class="welcome-icon welcome-learn-more"><?php echo __( 'We have complete documentation on every setting and feature', 'all-in-one-seo-pack' ); ?></a>

</li>
<li><a href="https://semperplugins.com/videos/"
target="_blank"><?php echo __( 'Access to video tutorials about SEO with the Pro version', 'all-in-one-seo-pack' ); ?></a>
target="_blank"
class="welcome-icon welcome-learn-more"><?php echo __( 'Access to video tutorials about SEO with the Pro version', 'all-in-one-seo-pack' ); ?></a>
</li>
<li><a href="https://semperplugins.com/all-in-one-seo-pack-pro-version/?loc=aio_welcome"
target="_blank"><?php echo __( 'Control SEO on categories, tags and custom taxonomies with the Pro version', 'all-in-one-seo-pack' ); ?></a>
target="_blank"
class="welcome-icon welcome-learn-more"><?php echo __( 'Control SEO on categories, tags and custom taxonomies with the Pro version', 'all-in-one-seo-pack' ); ?></a>
</li>
</ul>
</div>
Expand Down
4 changes: 2 additions & 2 deletions admin/display/welcome.php
Expand Up @@ -32,8 +32,8 @@ function welcome_screen_assets( $hook ) {

if ( 'dashboard_page_aioseop-about' === $hook ) {

wp_enqueue_style( 'aioseop_welcome_css', AIOSEOP_PLUGIN_URL . '/css/welcome.css', array(), AIOSEOP_VERSION );
wp_enqueue_script( 'aioseop_welcome_js', AIOSEOP_PLUGIN_URL . '/js/welcome.js', array( 'jquery' ), AIOSEOP_VERSION, true );
wp_enqueue_style( 'aioseop_welcome_css', AIOSEOP_PLUGIN_URL . 'css/welcome.css', array(), AIOSEOP_VERSION );
wp_enqueue_script( 'aioseop_welcome_js', AIOSEOP_PLUGIN_URL . 'js/welcome.js', array( 'jquery' ), AIOSEOP_VERSION, true );
}
}

Expand Down

0 comments on commit e7f6184

Please sign in to comment.