68% wp-zan

Code Review | Wordpress 文章点赞

WordPress plugin Wordpress 文章点赞 scored68%from 54 tests.

About plugin

  • Plugin page: wp-zan
  • Plugin version: 0.0.10
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.4.2
  • WordPress version: 6.3.1
  • First release: Aug 7, 2014
  • Latest release: Feb 16, 2016
  • Number of updates: 17
  • Update frequency: every 32.9 days
  • Top authors: afcold (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /8,287 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.02MB] [CPU: ▼6.92ms] Passed 4 tests

Analyzing server-side resources used by Wordpress 文章点赞
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.42 ▼0.0426.03 ▼14.51
Dashboard /wp-admin3.34 ▲0.0449.32 ▲2.39
Posts /wp-admin/edit.php3.46 ▲0.1046.84 ▼2.63
Add New Post /wp-admin/post-new.php5.92 ▲0.0491.91 ▼8.38
Media Library /wp-admin/upload.php3.27 ▲0.0436.70 ▼2.14
WP-Zan 设置 /wp-admin/options-general.php?page=wpzan.functions.php3.2334.18

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 15 new files
Database: 1 new table, 6 new options
New tables
wp_zan
New WordPress options
widget_recent-posts
db_upgraded
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Wordpress 文章点赞
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲6814.29 ▼0.072.07 ▲0.1846.08 ▲1.09
Dashboard /wp-admin2,199 ▲195.57 ▼0.1089.69 ▼1.3645.73 ▲0.71
Posts /wp-admin/edit.php2,104 ▲42.02 ▲0.0534.64 ▼1.8239.86 ▲5.06
Add New Post /wp-admin/post-new.php1,529 ▼623.72 ▲5.29686.00 ▼3.1255.82 ▼8.65
Media Library /wp-admin/upload.php1,401 ▲44.12 ▼0.09101.46 ▼12.8550.90 ▼0.05
WP-Zan 设置 /wp-admin/options-general.php?page=wpzan.functions.php1,2242.4151.8077.74

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • The uninstall procedure failed, leaving 1 table in the database
    • wp_zan
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These server-side errors were triggered
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wpzan.functions.php
    • > Notice in wp-content/plugins/wp-zan/include/wpzan-setting.php+41
    Trying to access array offset on value of type bool

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 take a closer look at the following
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/wp-zan/wp-zan.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-zan/wpzan.functions.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/wp-zan/include/wpzan-setting.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
1 plugin tags: wordpress

wp-zan/wp-zan.php Passed 13 tests

The main PHP file in "Wordpress 文章点赞" ver. 0.0.10 adds more information about the plugin and also serves as the entry point for this plugin
22 characters long description:
Wordpress 文章点赞

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
There were no executable files found in this plugin494 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP45246245
CSS2302202
JavaScript33435
SVG10012

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity10.00
▷ Minimum class complexity10.00
▷ Maximum class complexity10.00
Average method complexity2.80
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions17
▷ Named functions17100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG files were detected