78% wp-chinese-optimize

Code Review | WP-Chinese-Optimize

WordPress plugin WP-Chinese-Optimize scored78%from 54 tests.

About plugin

  • Plugin page: wp-chinese-optimize
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.8
  • WordPress version: 6.3.1
  • First release: Oct 12, 2017
  • Latest release: Oct 16, 2017
  • Number of updates: 3
  • Update frequency: every 1.3 days
  • Top authors: xunhuweb (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,495 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.07MB] [CPU: ▲0.57ms] Passed 4 tests

Server-side resources used by WP-Chinese-Optimize
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0739.50 ▲1.93
Dashboard /wp-admin3.37 ▲0.0745.24 ▼1.86
Posts /wp-admin/edit.php3.49 ▲0.1346.56 ▲1.16
Add New Post /wp-admin/post-new.php5.96 ▲0.0790.84 ▲1.05
Media Library /wp-admin/upload.php3.30 ▲0.0735.37 ▲3.65
网站优化 /wp-admin/admin.php?page=xh_wp_optimize3.2731.37
WP-Chinese-Optimize /wp-admin/admin.php?page=xh_wp_optimize_base3.1131.17

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 13 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

WP-Chinese-Optimize: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,808 ▲2214.28 ▼0.251.74 ▼0.1437.43 ▼2.80
Dashboard /wp-admin2,217 ▲395.59 ▼0.0484.09 ▼18.5741.00 ▼3.84
Posts /wp-admin/edit.php2,119 ▲222.00 ▼0.0239.99 ▲4.9341.48 ▲4.61
Add New Post /wp-admin/post-new.php1,547 ▲2123.23 ▲0.08594.71 ▼81.3052.70 ▼1.52
Media Library /wp-admin/upload.php1,422 ▲224.18 ▼0.0297.89 ▼4.9847.12 ▲2.90
网站优化 /wp-admin/admin.php?page=xh_wp_optimize9172.0021.8973.10
WP-Chinese-Optimize /wp-admin/admin.php?page=xh_wp_optimize_base280.420.124.68

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
Please take a closer look at the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'Gettext_Translations' not found in wp-content/plugins/wp-chinese-optimize/class-xh-mo.php:4

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/admin.php?page=xh_wp_optimize_base
    • > Network (severe)
    wp-admin/admin.php?page=xh_wp_optimize_base - Failed to load resource: the server responded with a status of 500 (Internal Server Error)

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes: The official readme.txt is a good inspiration

wp-chinese-optimize/init.php 85% from 13 tests

Analyzing the main PHP file in "WP-Chinese-Optimize" version 1.0.1
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("wp-chinese-optimize.php" instead of "init.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected990 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP12184171990

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity15.73
▷ Minimum class complexity1.00
▷ Maximum class complexity63.00
Average method complexity3.63
▷ Minimum method complexity1.00
▷ Maximum method complexity56.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes11
▷ Abstract classes327.27%
▷ Concrete classes872.73%
▷ Final classes00.00%
Methods66
▷ Static methods00.00%
▷ Public methods66100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions00.00%
▷ Anonymous functions2100.00%
Constants8
▷ Global constants8100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG images were found in this plugin