89% coolwp-pinyin-attachment-name

Code Review | CoolWP Pinyin Attachment Name

WordPress plugin CoolWP Pinyin Attachment Name scored89%from 54 tests.

About plugin

  • Plugin page: coolwp-pinyin-att...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-4.1.1
  • WordPress version: 6.3.1
  • First release: Mar 5, 2014
  • Latest release: Mar 17, 2015
  • Number of updates: 22
  • Update frequency: every 17.2 days
  • Top authors: suifengtec (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

200+ active /4,469 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

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

Analyzing server-side resources used by CoolWP Pinyin Attachment Name
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0142.24 ▼0.54
Dashboard /wp-admin3.32 ▲0.0244.38 ▼6.75
Posts /wp-admin/edit.php3.37 ▲0.0148.66 ▲1.49
Add New Post /wp-admin/post-new.php5.90 ▲0.0190.39 ▲1.84
Media Library /wp-admin/upload.php3.24 ▲0.0136.33 ▲4.88

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for CoolWP Pinyin Attachment Name
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲2913.26 ▼1.124.40 ▲2.5041.57 ▼4.32
Dashboard /wp-admin2,209 ▲185.85 ▲0.96106.73 ▲0.8242.22 ▲2.17
Posts /wp-admin/edit.php2,089 ▼02.02 ▼0.0439.73 ▲2.5935.72 ▼1.48
Add New Post /wp-admin/post-new.php1,533 ▲1423.11 ▲0.12647.77 ▲30.7157.20 ▼1.85
Media Library /wp-admin/upload.php1,391 ▲34.30 ▲0.1398.64 ▲0.0744.57 ▲3.09

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
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests Passed 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 no errors were found, this is by no means an exhaustive test

SRP Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: Please add images for these screenshots: #1 (即将上传的文件), #2 (上传后的文件名称。)
You can take inspiration from this readme.txt

coolwp-pinyin-attachment-name/wp-pinyin-attachment-name.php 85% from 13 tests

The primary PHP file in "CoolWP Pinyin Attachment Name" version 1.1 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("coolwp-pinyin-attachment-name.php" instead of "wp-pinyin-attachment-name.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 245 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected92 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP2263692

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity8.00
▷ Minimum class complexity8.00
▷ Maximum class complexity8.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes1100.00%
Methods7
▷ Static methods114.29%
▷ Public methods7100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
1 PNG file occupies 0.13MB with 0.12MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
banner-772x250.png136.23KB17.72KB▼ 86.99%