[oik] plugins.com

WordPress plugins and themes

  • Home
  • About
    • lazy shortcodes
    • smart shortcodes
    • oik base plugin
      • oik – donate
      • oik PayPal buttons
      • oik installation
      • oik Button Shortcode button
      • oik changelog
      • oik FAQ
      • oik plugins on SVN
      • oik plugins on GitHub
  • Plugins
    • oik base plugin
    • FREE oik plugins
    • WordPress plugins
    • Premium oik plugins
    • Bespoke oik plugins
  • Shortcodes
    • Shortcode examples
  • Blocks
    • Block examples
  • APIs
    • ALL action and filter hooks
  • Blog

bw_check_gitrepos() – Implement ‘pre_current_active_plugins’ to perform Git repo checking

You appear to be a bot. Output may be restricted

Description

Implement 'pre_current_active_plugins' to perform Git repo checking

Disable updates for Git repositories. This should also work for Git repositories in symlinked plugins. There must be at least one plugin in the $wp_list_table if it's set; since we're that plugin. The plugin_data['plugin'] is only set if there is an update available.

Usage

bw_check_gitrepos();

Parameters

Returns

void

TO DO

Trying to change the items in the wp_list_table doesn't appear to work. Remove this logic if that's the case.

Source

File name: oik/admin/oik-admin.php
Lines:
1 to 41 of 41
function bw_check_gitrepos() {
  global $wp_list_table;
  if ( isset( $wp_list_table ) ) {
    $myplugins = $wp_list_table->items;
    $normalized = wp_normalize_path( WP_PLUGIN_DIR );
    foreach ( $myplugins as $plugin => $plugin_data ) {
      $new_version = bw_array_get( $plugin_data, "new_version", null );
      $slug = bw_array_get( $plugin_data, "slug", null );
      //if ( $new_version ) {
        bw_trace2( $new_version, "new_version", false );
        // For some plugins the $plugin key and $plugin_data['plugin'] are different.
        // so we should be using $plugin here
        $plugin_file = $plugin; 
        $plugin_path = $normalized . '/' . $slug;
        bw_trace2( $plugin_path, "plugin_path", false );
        $real_path = realpath( $plugin_path );
        $real_path = wp_normalize_path( $real_path );
        bw_trace2( $real_path, "real_path" );
        

        $gitdir = "$real_path/.git";
        $dotgit = file_exists( $gitdir );
        if ( $dotgit && is_dir( $gitdir ) ) {
          //gob();
          $myplugins[ $plugin ]['update'] = 0;
          $myplugins[ $plugin ]['real_path'] = $real_path;
          unset( $myplugins[ $plugin ]['package'] );
          //remove_action( "after_plugin_row_" . $plugin_data['plugin'], "
          add_action( "in_plugin_update_message-" . $plugin_file, "bw_gitrepo_plugin", 10, 2 ); 
           
          remove_action( "after_plugin_row_$plugin_file", 'wp_plugin_update_row', 10, 2 );
          add_action( "after_plugin_row_" . $plugin_file, "bw_gitrepo_after_plugin_row", 10, 2 ); 
          bw_trace2( $plugin_data, "plugin_data", false, BW_TRACE_VERBOSE );
        }
      //}
    }
    bw_trace2( $wp_list_table->items, "Items" ); 
    bw_trace2( $myplugins, "myplugins" );
    $wp_list_table->items = $myplugins;
  }
}
 
 View on GitHub View on Trac

Published: February 2, 2018 | Last updated: February 2, 2018

Information

Function name: bw_check_gitrepos
Plugin ref: oik – oik information kit
Version: 4.8.2
Sourcefile: admin/oik-admin.php
File ref: admin/oik-admin.php
API type: to
Deprecated?: No
API Letters: B,C,G

Recent plugin updates

oik-weight-zone-shipping v0.2.6 oik-weight-zone-shipping v0.2.6 has been tested with WooCommerce 7.4.0. ...
sb-chart-block v1.2.3 SB Chart Block v1.2.3 contains a fix for an Uncaught Error: Call to undefined function bw_trace2()  ...
SB Chart Block v1.2.1 Update to SB Chart Block v1.2.0 for custom colors, font size options and multiple y-axis charts.  ...
oik-css v2.1.0 Update to oik-css v2.1.0 for the ability to style CSS and GeSHi output in documentation. ...
oik-types v2.3.0 Update to oik-types v2.3.0 for improved control over sort order on archives ...

Plugins

  • All Plugins
  • oik base plugin
  • FREE oik plugins
  • WordPress plugins
  • Premium oik plugins

Themes

  • FREE themes
  • Bespoke themes
  • Premium themes

Blocks

  • All Blocks
  • Block examples
  • About Blocks

Shortcodes

  • All Shortcodes
  • Shortcode examples
  • About Shortcodes

Reference

  • About APIs
  • All APIs
  • All Classes
  • All Files
  • All Hooks

Support

  • Contact
  • Cookies policy
  • Get API key
  • Privacy
  • Request support
  • Sitemap
  • Stay informed
  • Terms and Conditions
oik-plugins
Email: herb@bobbingwide.com

Weight shipping plugins

Find out which cart weight shipping plugin you need for your WooCommerce site.
Which cart weight based plugin do I need?

Site:  www.oik-plugins.com
© Copyright oik-plugins 2011-2023. All rights reserved.


Website designed and developed by Herb Miller of Bobbing Wide
Proudly powered by WordPress and oik-plugins
WordPress 6.1.1. PHP: 7.4.33. Memory limit: 768M