File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ class Application extends \WpStarter\Foundation\Application
1111 *
1212 * @var string
1313 */
14- const VERSION = '1.9.4 ' ;
14+ const VERSION = '1.9.5 ' ;
1515
1616 protected $ bootstrappedList = [];
1717
Original file line number Diff line number Diff line change 88class Updater
99{
1010 protected $ pluginsRepository ;
11+ protected $ pluginsDir ;
1112 public function __construct ($ pluginsDir )
1213 {
14+ $ this ->pluginsDir =$ pluginsDir ;
1315 $ this ->pluginsRepository =new Repository ($ pluginsDir );
1416 }
1517
@@ -26,7 +28,16 @@ function getUpdates(){
2628 'locale ' => json_encode ( [] ),
2729 'all ' => json_encode ( true ),
2830 );
29- $ userAgent = 'WordPress/6.2.2 ' . '; ' . 'http://localhost ' ;
31+ if (defined ('ABSPATH ' ) && defined ('WPINC ' )){
32+ $ versionFile = ABSPATH . WPINC . '/version.php ' ;
33+ }else {
34+ $ versionFile = dirname (dirname ($ this ->pluginsDir )) . '/wp-includes/version.php ' ;
35+ }
36+ $ wp_version = '6.x ' ;
37+ if ( file_exists ( $ versionFile ) ) {
38+ include $ versionFile ;
39+ }
40+ $ userAgent = 'WordPress/ ' .$ wp_version . '; ' . 'http://localhost ' ;
3041 $ formData =http_build_query ($ data );
3142 $ headers = array (
3243 'Content-Type: application/x-www-form-urlencoded ' ,
You can’t perform that action at this time.
0 commit comments