83% wp-baidu-fanyi

Code Review | WP百度翻译插件

WordPress plugin WP百度翻译插件 scored83%from 54 tests.

About plugin

  • Plugin page: wp-baidu-fanyi
  • Plugin version: 1.1.0
  • PHP compatiblity: 5.3.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-5.3.2
  • WordPress version: 6.3.1
  • First release: Jun 28, 2019
  • Latest release: Jan 8, 2020
  • Number of updates: 5
  • Update frequency: every 39.2 days
  • Top authors: wbolt (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active /4,085 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.01MB] [CPU: ▼0.66ms] Passed 4 tests

Analyzing server-side resources used by WP百度翻译插件
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0040.47 ▲3.64
Dashboard /wp-admin3.32 ▲0.0248.50 ▲2.72
Posts /wp-admin/edit.php3.37 ▲0.0250.01 ▲2.87
Add New Post /wp-admin/post-new.php5.92 ▲0.0483.57 ▼11.86
Media Library /wp-admin/upload.php3.25 ▲0.0237.95 ▲6.72
WP百度翻译管理 /wp-admin/options-general.php?page=wp_bdfy_pack3.2535.47

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

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

Browser metrics Passed 4 tests

A check of browser resources used by WP百度翻译插件
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5814.80 ▲0.421.96 ▲0.3443.16 ▲3.53
Dashboard /wp-admin2,210 ▲255.79 ▼0.03104.66 ▼0.7040.96 ▲0.61
Posts /wp-admin/edit.php2,093 ▲221.99 ▼0.0339.84 ▲0.4640.38 ▲8.35
Add New Post /wp-admin/post-new.php1,529 ▲123.06 ▲4.88618.26 ▲25.5046.78 ▼10.12
Media Library /wp-admin/upload.php1,389 ▼24.21 ▼0.0393.86 ▼10.5748.89 ▲2.66
WP百度翻译管理 /wp-admin/options-general.php?page=wp_bdfy_pack1,0002.2123.9587.75

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
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP Passed 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
The SRP test was a success

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There are user-side issues you should fix
    • > GET request to /wp-admin/options-general.php?page=wp_bdfy_pack
    • > Network (severe)
    https://www.wbolt.com/wb-api/v1/news/lastest - Failed to load resource: the server responded with a status of 500 ()

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
1 plugin tags: baidu

wp-baidu-fanyi/index.php 85% from 13 tests

"WP百度翻译插件" version 1.1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 158 characters long)
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wp-baidu-fanyi.php" instead of "index.php")

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 plugin700 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP412253663
JavaScript329034
CSS30123

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity11.00
▷ Minimum class complexity11.00
▷ Maximum class complexity11.00
Average method complexity1.62
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods16
▷ Static methods425.00%
▷ Public methods16100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
4 PNG files occupy 1.29MB with 0.93MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot/banner-1544x500.png779.55KB241.22KB▼ 69.06%
screenshot/banner-772x250.png211.27KB72.64KB▼ 65.62%
screenshot/icon-128x128.png73.01KB18.78KB▼ 74.28%
screenshot/icon-256x256.png259.12KB57.39KB▼ 77.85%