Plugin Directory

Changeset 2353962


Ignore:
Timestamp:
08/06/2020 01:14:09 PM (6 years ago)
Author:
timvaniersel
Message:

add multisite support

Location:
remove-schema/trunk
Files:
1 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • remove-schema/trunk/README.txt

    r2286662 r2353962  
    5353== Changelog ==
    5454
     55= 1.3.4 =
     56* Add multisite support
     57
     58= 1.3.3 =
     59* Remove review notice
     60
    5561= 1.3.2 =
    5662* Bugfixes - page specific markup wouldn't save if everything was unchecked.
  • remove-schema/trunk/admin/partials/remove-schema-admin-display.php

    r2215002 r2353962  
    2929
    3030    <?php
    31     include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
     31    require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
    3232
    3333    //Grab all options
    3434    $options = get_option($this->plugin_name);
    35 
    36     if (empty($options)) {
    37       $options = array();
    38       $options['rm_jsonld'] = false;
    39       $options['yoast_jsonld'] = false;
    40       $options['woocommerce_jsonld'] = false;
    41       $options['woocommerce_mail_jsonld'] = false;
    42       $options['schema_pro'] = false;
    43       $options['microdata'] = false;
    44       $options['rdfa'] = false;
    45       $options['generatepress_schema'] = false;
    46       $options['remove_hentry_schema'] = false;
    47     }
    4835
    4936    // Schema
     
    5845    $remove_hentry_schema = $options['remove_hentry_schema'];
    5946
    60     ?>
     47    function pluginnl_plugin_is_active( $pluginpath ){
     48     if ( is_multisite() ) {
     49        if(is_plugin_active_for_network( $pluginpath ) || is_plugin_active( $pluginpath )){
     50          $active = true;
     51        }else{
     52          $active = false;
     53        }
     54        } else {
     55          $active =  is_plugin_active( $pluginpath ) ? true : false;
     56        }
     57      return $active;
     58    }
    6159
    62     <?php
    6360    settings_fields($this->plugin_name);
    6461    do_settings_sections($this->plugin_name);
     
    7067
    7168          <!-- remove Yoast JSONLD -->
    72           <?php if ( is_plugin_active( 'wordpress-seo/wp-seo.php' ) ) { ?>
     69          <?php if ( pluginnl_plugin_is_active( 'wordpress-seo/wp-seo.php' ) ) { ?>
    7370          <fieldset>
    7471            <legend class="screen-reader-text"><span><?php _e('Remove Yoast JSON-LD', $this->plugin_name); ?></span></legend>
     
    8178
    8279          <!-- remove WooCommerce JSONLD -->
    83           <?php if ( is_plugin_active( 'woocommerce/woocommerce.php' ) ) { ?>
     80          <?php if ( pluginnl_plugin_is_active( 'woocommerce/woocommerce.php' ) ) { ?>
    8481          <fieldset>
    8582            <legend class="screen-reader-text"><span><?php _e('Remove WooCommerce JsonLD', $this->plugin_name); ?></span></legend>
     
    9289
    9390          <!-- remove  JSONLD in WooCommerce emails -->
    94           <?php if ( is_plugin_active( 'woocommerce/woocommerce.php' ) ) { ?>
     91          <?php if ( pluginnl_plugin_is_active( 'woocommerce/woocommerce.php' ) ) { ?>
    9592          <fieldset>
    9693            <legend class="screen-reader-text"><span><?php _e('Remove WooCommerce JsonLD in Emails', $this->plugin_name); ?></span></legend>
     
    103100
    104101          <!-- Remove schema pro schema -->
    105           <?php if ( is_plugin_active( 'wp-schema-pro/wp-schema-pro.php' ) ) { ?>
     102          <?php if ( pluginnl_plugin_is_active( 'wp-schema-pro/wp-schema-pro.php' ) ) { ?>
    106103          <fieldset>
    107104            <legend class="screen-reader-text"><span><?php _e('Remove Schema pro JSON-LD', $this->plugin_name); ?></span></legend>
  • remove-schema/trunk/admin/partials/remove-schema-post-editor-display.php

    r2249025 r2353962  
    3636$microdata = $options['microdata'];
    3737$rdfa = $options['rdfa'];
     38
     39function pluginnl_plugin_is_active( $pluginpath ){
     40 if ( is_multisite() ) {
     41    if(is_plugin_active_for_network( $pluginpath ) || is_plugin_active( $pluginpath )){
     42      $active = true;
     43    }else{
     44      $active = false;
     45    }
     46  } else {
     47    $active =  is_plugin_active( $pluginpath ) ? true : false;
     48  }
     49  return $active;
     50}
    3851?>
    3952<input class="hidden" style="display:none;" type="text" id="<?php echo $this->plugin_name; ?>-fake-field" name="<?php echo $this->plugin_name; ?>[fake_field]" value="1" />
     
    4861<?php esc_attr_e('Remove all JSON-LD', $this->plugin_name); ?></br>
    4962
    50 <?php if ( is_plugin_active( 'wordpress-seo/wp-seo.php' ) ) { ?>
     63<?php if ( pluginnl_plugin_is_active( 'wordpress-seo/wp-seo.php' ) ) { ?>
    5164<input type="checkbox" id="<?php echo $this->plugin_name; ?>-yoast-json-ld" name="<?php echo $this->plugin_name; ?>[yoast_jsonld]" value="1" <?php checked($yoast_jsonld, 1); ?> />
    5265<?php esc_attr_e('Remove Yoast JSON-LD', $this->plugin_name); ?></br>
    5366<?php } ?>
    5467
    55 <?php if ( is_plugin_active( 'woocommerce/woocommerce.php' ) ) { ?>
     68<?php if ( pluginnl_plugin_is_active( 'woocommerce/woocommerce.php' ) ) { ?>
    5669<input type="checkbox" id="<?php echo $this->plugin_name; ?>-woocommerce-json-ld" name="<?php echo $this->plugin_name; ?>[woocommerce_jsonld]" value="1" <?php checked($woocommerce_jsonld, 1); ?> />
    5770<?php esc_attr_e('Remove WooCommerce JSON-LD', $this->plugin_name); ?></br>
    5871<?php } ?>
    5972
    60 <?php if ( is_plugin_active( 'wp-schema-pro/wp-schema-pro.php' ) ) { ?>
     73<?php if ( pluginnl_plugin_is_active( 'wp-schema-pro/wp-schema-pro.php' ) ) { ?>
    6174<input type="checkbox" id="<?php echo $this->plugin_name; ?>-schema-pro" name="<?php echo $this->plugin_name; ?>[schema_pro]" value="1" <?php checked($schema_pro, 1); ?> />
    6275<?php esc_attr_e('Remove Schema pro JSON-LD', $this->plugin_name); ?></br>
  • remove-schema/trunk/includes/class-remove-schema.php

    r2200104 r2353962  
    7171            $this->version = REMOVE_SCHEMA_VERSION;
    7272        } else {
    73             $this->version = '1.0.0';
     73            $this->version = '1.3.4';
    7474        }
    7575        $this->plugin_name = 'remove-schema';
     
    128128        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-remove-schema-public.php';
    129129
    130         /**
    131          * The class responsible prompting a review notice one week after installing the plugin
    132          */
    133         require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-remove-schema-plugin-review.php';
    134 
    135 
    136130        $this->loader = new Remove_Schema_Loader();
    137131
     
    186180        // Save/Update page specific options
    187181        $this->loader->add_action('save_post', $plugin_post_editor, 'options_update');
    188 
    189         new Remove_Schema_Plugin_Review( array(
    190             'slug'        => 'remove-schema',  // The plugin slug
    191             'name'        => 'Remove Schema', // The plugin name
    192             'time_limit'  => WEEK_IN_SECONDS,     // The time limit at which notice is shown
    193         ) );
    194182
    195183    }
  • remove-schema/trunk/remove-schema.php

    r2249025 r2353962  
    1717 * Plugin URI:        https://plugin.nl/en/remove-schema-plugin/
    1818 * Description:       Remove all Microdata, RDFa and/or JSON-ld that you don’t want on your page.
    19  * Version:           1.3.2
     19 * Version:           1.3.4
    2020 * Author:            Plugin.nl
    2121 * Author URI:        https://plugin.nl/en/remove-schema-plugin/
     
    3434 * Currently plugin version.
    3535 */
    36 define( 'REMOVE_SCHEMA_VERSION', '1.3.2' );
     36define( 'REMOVE_SCHEMA_VERSION', '1.3.4' );
    3737
    3838/**
Note: See TracChangeset for help on using the changeset viewer.