74% pangu

Code Review | Pangu: 自动在中英文间添加空格

WordPress plugin Pangu: 自动在中英文间添加空格 scored74%from 54 tests.

About plugin

  • Plugin page: pangu
  • Plugin version: 1.0.1.1
  • PHP compatiblity: 5.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-5.7
  • WordPress version: 6.3.1
  • First release: Apr 24, 2021
  • Latest release: Apr 24, 2021
  • Number of updates: 3
  • Update frequency: every 1.0 days
  • Top authors: hzy1996 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /388 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▼1.94MB] [CPU: ▼55.73ms] Passed 4 tests

An overview of server-side resources used by Pangu: 自动在中英文间添加空格
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.05 ▼1.424.67 ▼40.84
Dashboard /wp-admin2.07 ▼1.247.59 ▼44.65
Posts /wp-admin/edit.php2.07 ▼1.295.80 ▼44.18
Add New Post /wp-admin/post-new.php2.07 ▼3.826.77 ▼93.26
Media Library /wp-admin/upload.php2.07 ▼1.166.66 ▼29.02

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Pangu: 自动在中英文间添加空格
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲6013.24 ▼1.512.04 ▲0.3043.40 ▲0.22
Dashboard /wp-admin2,208 ▲205.84 ▲0.02105.81 ▼8.9238.36 ▼4.87
Posts /wp-admin/edit.php2,091 ▲22.04 ▲0.0139.04 ▲2.4331.90 ▼3.20
Add New Post /wp-admin/post-new.php1,531 ▼1123.16 ▲4.92680.98 ▲80.0855.51 ▲6.98
Media Library /wp-admin/upload.php1,384 ▲54.14 ▼0.08106.66 ▲1.4646.15 ▲2.81

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
These items require your attention
  • Uninstall procedure validation failed for this plugin
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the pangu.js handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 75% 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)
Even though everything seems fine, this is not an exhaustive test

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
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_script() in wp-content/plugins/pangu/pangu.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
2 plugin tags: beauty, chinese

pangu/pangu.php 92% from 13 tests

The primary PHP file in "Pangu: 自动在中英文间添加空格" version 1.0.1.1 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 181 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected572 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript29751570
PHP11142

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.00
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There are no PNG files in this plugin