10% wp2pcs-sy

Code Review | WP2PCS-SY (WordPress连接到网盘)

WordPress plugin WP2PCS-SY (WordPress连接到网盘) scored 10% from 54 tests.

About plugin

  • Plugin page: wp2pcs-sy
  • Plugin version: 1.3.12
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.1-4.2.2
  • WordPress version: 6.3.1
  • First release: Nov 13, 2014
  • Latest release: May 24, 2015
  • Number of updates: 22
  • Update frequency: every 8.8 days
  • Top authors: wishinlife (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 9,727 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
It is recommended to fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/wp2pcs-sy/wp2pcs-setup-functions.php+292
    Array and string offset access syntax with curly braces is deprecated

Server metrics [RAM: ▼0.89MB] [CPU: ▼28.13ms] Passed 4 tests

Analyzing server-side resources used by WP2PCS-SY (WordPress连接到网盘)
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0544.37 ▲0.27
Dashboard /wp-admin3.05 ▼0.2526.44 ▼18.92
Posts /wp-admin/edit.php3.05 ▼0.3039.25 ▼12.63
Add New Post /wp-admin/post-new.php3.05 ▼2.8325.35 ▼74.32
Media Library /wp-admin/upload.php3.05 ▼0.1826.83 ▼6.66
百度网盘 /wp-admin/upload.php?page=wp2pcs-sy-netdisk3.0526.27
WP2PCS-SY /wp-admin/options-general.php?page=wp2pcs-sy3.0524.56

Server storage [IO: ▲1.00MB] [DB: ▲0.00MB] Passed 3 tests

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 38 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
widget_recent-posts
db_upgraded
widget_theysaidso_widget
wp_to_pcs_remote_aplication

Browser metrics Passed 4 tests

WP2PCS-SY (WordPress连接到网盘): an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,808 ▲7313.34 ▼1.071.70 ▼0.0544.47 ▼9.37
Dashboard /wp-admin2,211 ▲235.82 ▲0.9196.49 ▼9.5643.44 ▼0.06
Posts /wp-admin/edit.php2,094 ▲52.01 ▼0.0535.76 ▼5.5254.00 ▲16.20
Add New Post /wp-admin/post-new.php1,525 ▲1123.09 ▲5.37646.26 ▼19.6951.25 ▼1.54
Media Library /wp-admin/upload.php1,396 ▲54.17 ▼0.06105.90 ▲8.3850.64 ▲2.75
百度网盘 /wp-admin/upload.php?page=wp2pcs-sy-netdisk9281.9225.3967.67
WP2PCS-SY /wp-admin/options-general.php?page=wp2pcs-sy9332.1240.5559.25

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% from 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/wp2pcs-sy/wp-backup-to-baidu-pcs.php+40
    Undefined index: action
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These errors were triggered by the plugin
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wp2pcs-sy
    • > Notice in wp-content/plugins/wp2pcs-sy/wp-backup-to-baidu-pcs.php+40
    Undefined index: action
    • > GET request to /wp-admin/upload.php?page=wp2pcs-sy-netdisk
    • > Notice in wp-content/plugins/wp2pcs-sy/libs/RequestCore.class.php+528
    curl_setopt(): CURLOPT_SSL_VERIFYHOST no longer accepts the value 1, value 2 will be used instead
    • > GET request to /wp-admin/upload.php?page=wp2pcs-sy-netdisk
    • > Warning in wp-content/plugins/wp2pcs-sy/libs/RequestCore.class.php+529
    Use of undefined constant CURLOPT_CLOSEPOLICY - assumed 'CURLOPT_CLOSEPOLICY' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/upload.php?page=wp2pcs-sy-netdisk
    • > Warning in wp-content/plugins/wp2pcs-sy/libs/RequestCore.class.php+529
    Use of undefined constant CURLCLOSEPOLICY_LEAST_RECENTLY_USED - assumed 'CURLCLOSEPOLICY_LEAST_RECENTLY_USED' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/upload.php?page=wp2pcs-sy-netdisk
    • > Warning in wp-content/plugins/wp2pcs-sy/libs/RequestCore.class.php+529
    curl_setopt() expects parameter 2 to be int, string given
    • > GET request to /wp-admin/upload.php?page=wp2pcs-sy-netdisk
    • > Notice in wp-content/plugins/wp2pcs-sy/wp-storage-insert-to-content.php+440
    Undefined property: stdClass::$list
    • > GET request to /wp-admin/upload.php?page=wp2pcs-sy-netdisk
    • > Warning in wp-content/plugins/wp2pcs-sy/wp-storage-file-manage.php+308
    count(): Parameter must be an array or an object that implements Countable
    • > GET request to /wp-admin/options-general.php?page=wp2pcs-sy
    • > Notice in wp-content/plugins/wp2pcs-sy/wp2pcs-setup-functions.php+139
    Undefined index: HTTPS

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 12× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/wp2pcs-sy/wp-diff-to-baidu-pcs.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wp2pcs-sy/wp2pcs-sy.php:25
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/wp2pcs-sy/wp-storage-audio-online.php:55
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp2pcs-sy/wp-storage-file-manage.php:430
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/wp2pcs-sy/wp-storage-image-outlink.php:77
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp2pcs-sy/wp-storage-to-baidu-pcs.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/wp2pcs-sy/wp-backup-to-baidu-pcs.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp2pcs-sy/wp-storage-download-file.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/wp2pcs-sy/wp-storage-video-online.php:88
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp2pcs-sy/wp-storage-media-online.php:18

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please take a look at the following user-side issues
    • > GET request to /wp-admin/upload.php?page=wp2pcs-sy-netdisk
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: $(...).live is not a function" "TypeError: $(...).live is not a function\n at HTMLDocument.\u003Canonymous> (/wp-admin/upload.php?page=wp2pcs-sy-netdisk:222:36)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/upload.php?page=wp2pcs-sy-netdisk
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: $(...).live is not a function
    • > GET request to /wp-admin/options-general.php?page=wp2pcs-sy
    • > Network (severe)
    http://www.syncy.cn/newdonor?jsonpcallback=success_jsonpCallback&_=1696190219662 - Failed to load resource: net::ERR_NAME_NOT_RESOLVED

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
6 plugin tags: backup, personal cloud storage, pcs, sync, baidu...

wp2pcs-sy/wp2pcs-sy.php 92% from 13 tests

Analyzing the main PHP file in "WP2PCS-SY (WordPress连接到网盘)" version 1.3.12
Please take the time to fix the following:
  • Description: The description should be shorter than 140 characters (currently 583 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected4,797 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
PHP173951,3423,716
JavaScript468731,077
XML1004

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity20.00
▷ Minimum class complexity1.00
▷ Maximum class complexity61.00
Average method complexity2.29
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods59
▷ Static methods00.00%
▷ Public methods5796.61%
▷ Protected methods00.00%
▷ Private methods23.39%
Functions90
▷ Named functions90100.00%
▷ Anonymous functions00.00%
Constants18
▷ Global constants1372.22%
▷ Class constants527.78%
▷ Public constants5100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
5 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
asset/audio.png2.53KB2.13KB▼ 15.92%
asset/default.png0.44KB0.59KB0.00%
asset/archive.png2.83KB2.41KB▼ 14.91%
asset/folder.png6.52KB2.43KB▼ 62.79%
asset/video.png1.31KB2.05KB0.00%