84% wp-slug-baidu-translate

Code Review | 百度翻译别名

WordPress plugin 百度翻译别名 scored 84% from 54 tests.

About plugin

  • Plugin page: wp-slug-baidu-tra...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.0.3
  • WordPress version: 6.3.1
  • First release: Apr 27, 2016
  • Latest release: Jan 31, 2019
  • Number of updates: 6
  • Update frequency: every 168.2 days
  • Top authors: 0 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,690 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

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

Server-side resources used by 百度翻译别名
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0236.58 ▼11.73
Dashboard /wp-admin3.32 ▲0.0242.76 ▼3.25
Posts /wp-admin/edit.php3.38 ▲0.0246.90 ▼1.22
Add New Post /wp-admin/post-new.php5.90 ▲0.0289.84 ▼8.35
Media Library /wp-admin/upload.php3.25 ▲0.0237.59 ▲7.73
百度翻译别名 /wp-admin/options-general.php?page=wp-slug-baidu-translate/wp-slug-baidu-translate.php3.2131.08

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

百度翻译别名: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5814.41 ▲0.111.59 ▼0.7741.41 ▲4.94
Dashboard /wp-admin2,213 ▲255.88 ▼0.02100.20 ▼5.7544.03 ▲3.07
Posts /wp-admin/edit.php2,096 ▲72.02 ▼0.0040.65 ▲1.0241.55 ▲6.82
Add New Post /wp-admin/post-new.php1,539 ▼323.35 ▲4.99606.14 ▲2.4547.11 ▼0.35
Media Library /wp-admin/upload.php1,389 ▲14.20 ▲0.0298.25 ▼6.0544.66 ▼2.51
百度翻译别名 /wp-admin/options-general.php?page=wp-slug-baidu-translate/wp-slug-baidu-translate.php8422.0223.7372.32

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
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× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-slug-baidu-translate/wp-slug-baidu-translate.php:19

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 Passed 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
3 plugin tags: postname, title, slug

wp-slug-baidu-translate/wp-slug-baidu-translate.php Passed 13 tests

The main file in "百度翻译别名" v. 1.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
93 characters long description:
输入和编辑文章、页面标题时,通过百度翻译自动将别名翻译成英文。

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin82 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP191382

PHP code Passed 2 tests

This is a very shot 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.17
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%
Functions5
▷ Named functions5100.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
3 PNG files occupy 0.05MB with 0.02MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/screenshot-1.png14.54KB6.20KB▼ 57.37%
images/qr-alipay.png16.18KB9.46KB▼ 41.53%
images/screenshot-2.png17.77KB7.54KB▼ 57.57%