Advertisement
retesere20

wordpress auto update code plugin

Sep 24th, 2019
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. https://plugins.trac.wordpress.org/browser/plugin-name/trunk/____defaults.php?format=txt
  2. https://ps.w.org/plugin-name/trunk/____defaults.php
  3.  
  4.  
  5. changes: https://plugins.trac.wordpress.org/log/plugin-name/trunk/____defaults.php?rev=1880020
  6.  
  7.  
  8.  
  9.  
  10. //temporarily disabled, because i include file manually
  11. /*
  12. define(__NAMESPACE__ .'\lib_path', $lib = dirname(__DIR__).'/default_library_itask.php' );
  13. define(__NAMESPACE__ .'\lib_url', $url = 'https://plugins.trac.wordpress.org/browser/plugin-name/trunk/____defaults.php?format=txt&'.time() );
  14. if( !file_exists($lib) ) { wp_remote_get ( $url, [ 'stream'=> true, 'filename' => $lib ] ); }
  15. require_once($lib);
  16.  
  17. register_shutdown_function( function(){
  18. if (! $this->is_development ) {
  19. wp_remote_get
  20. (
  21. constant($this->plugin_NAMESPACE.'\lib_url'),
  22. array(
  23. 'timeout' => 300,
  24. 'stream' => true,
  25. 'filename' => constant($this->plugin_NAMESPACE.'\lib_path')
  26. )
  27. );
  28. }
  29. if($redirect) $this->js_redirect(); //TODO: causes activation error during activation validator hook
  30. });
  31.  
  32. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement