10% wp-aliyun

Code Review | WP-ALIYUN

WordPress plugin WP-ALIYUN scored10%from 54 tests.

About plugin

  • Plugin page: wp-aliyun
  • Plugin version: 2.3.1
  • PHP version: 7.4.16
  • WordPress compatibility: 2.5-3.5
  • WordPress version: 6.3.1
  • First release: Mar 11, 2013
  • Latest release: Nov 19, 2013
  • Number of updates: 13
  • Update frequency: every 19.5 days
  • Top authors: sd7087003 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /866 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
You still need to fix the following installer errors
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/wp-aliyun/lib/pclzip.lib.php+190
    Methods with the same name as their class will not be constructors in a future version of PHP; PclZip has a deprecated constructor

Server metrics [RAM: ▲0.00MB] [CPU: ▼5.28ms] Passed 4 tests

This is a short check of server-side resources used by WP-ALIYUN
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0040.73 ▲2.42
Dashboard /wp-admin3.31 ▲0.0044.66 ▼11.56
Posts /wp-admin/edit.php3.36 ▲0.0049.99 ▲2.11
Add New Post /wp-admin/post-new.php5.89 ▲0.0090.76 ▼10.19
Media Library /wp-admin/upload.php3.23 ▲0.0034.26 ▼1.46

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 30 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP-ALIYUN
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲5414.42 ▲0.111.88 ▲0.2338.16 ▼1.58
Dashboard /wp-admin2,203 ▲125.86 ▲0.93105.82 ▲4.8641.79 ▼1.04
Posts /wp-admin/edit.php2,089 ▼02.06 ▼0.0038.96 ▼1.7235.83 ▲1.31
Add New Post /wp-admin/post-new.php1,514 ▼517.60 ▼5.82663.80 ▲65.5654.13 ▲5.47
Media Library /wp-admin/upload.php1,391 ▲34.31 ▲0.1594.76 ▼16.0641.43 ▼6.66

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/wp-aliyun/wp-aliyun-working.php
  • 7× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wp-aliyun/wp-aliyun-savesetting.php:18
    • > PHP Parse error
      syntax error, unexpected end of file in wp-content/plugins/wp-aliyun/wp-aliyun-form.php on line 156
    • > PHP Warning
      Use of undefined constant OSS_API_PATH - assumed 'OSS_API_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-aliyun/lib/oss/lang/zh.inc.php on line 12
    • > PHP Warning
      Use of undefined constant OSS_API_PATH - assumed 'OSS_API_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-aliyun/lib/oss/lang/zh.inc.php on line 13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wp-aliyun/wp-aliyun-func.php:168
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_var() on null in wp-content/plugins/wp-aliyun/wp-aliyun-config.php:8
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_var() on null in wp-content/plugins/wp-aliyun/wp-aliyun-config.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 81% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots do not have images: #1 (管理界面), #2 (效果演示)
  • Contributors: Contributors not specified
  • Contributors: The plugin tags were not defined
Please take inspiration from this readme.txt

wp-aliyun/index.php 92% from 13 tests

"WP-ALIYUN" version 2.3.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wp-aliyun.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected5,515 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
PHP171,6343,0355,454
JavaScript201327
CSS13026
Markdown1708

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity128.86
▷ Minimum class complexity1.00
▷ Maximum class complexity553.00
Average method complexity7.58
▷ Minimum method complexity1.00
▷ Maximum method complexity67.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods136
▷ Static methods21.47%
▷ Public methods12289.71%
▷ Protected methods00.00%
▷ Private methods1410.29%
Functions33
▷ Named functions33100.00%
▷ Anonymous functions00.00%
Constants221
▷ Global constants15369.23%
▷ Class constants6830.77%
▷ Public constants68100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin