90% so-pinyin-slugs

Code Review | Pinyin Slugs

WordPress plugin Pinyin Slugs scored90%from 54 tests.

About plugin

  • Plugin page: so-pinyin-slugs
  • Plugin version: 2.3.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.4
  • WordPress version: 6.3.1
  • First release: Aug 19, 2013
  • Latest release: Nov 27, 2023
  • Number of updates: 97
  • Update frequency: every 38.7 days
  • Top authors: senlin (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

3,000+ active /42,466 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.17MB] [CPU: ▼0.16ms] Passed 4 tests

This is a short check of server-side resources used by Pinyin Slugs
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.62 ▲0.1636.66 ▼5.02
Dashboard /wp-admin3.48 ▲0.1848.50 ▼0.30
Posts /wp-admin/edit.php3.53 ▲0.1846.45 ▲1.16
Add New Post /wp-admin/post-new.php6.06 ▲0.1890.93 ▲3.54
Media Library /wp-admin/upload.php3.41 ▲0.1836.46 ▲5.91
Pinyin Slugs /wp-admin/options-general.php?page=so-pinyin-slugs/so-pinyin-slugs.php3.3732.64

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 14 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
sops_options
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Pinyin Slugs
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,794 ▲3214.67 ▲0.391.84 ▲0.2141.35 ▼4.30
Dashboard /wp-admin2,199 ▲215.56 ▼0.1289.93 ▼25.2038.31 ▼9.12
Posts /wp-admin/edit.php2,104 ▲41.97 ▲0.0239.62 ▲0.9635.44 ▲2.02
Add New Post /wp-admin/post-new.php1,529 ▲323.41 ▲0.23635.11 ▲38.9960.20 ▲16.25
Media Library /wp-admin/upload.php1,404 ▲14.14 ▼0.0493.60 ▼1.2941.19 ▲0.58
Pinyin Slugs /wp-admin/options-general.php?page=so-pinyin-slugs/so-pinyin-slugs.php9442.0025.2534.39

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget

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)
Everything seems fine, however this is by no means an exhaustive test

SRP Passed 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
7 plugin tags: mandarin, pinyin, chinese, simplified, traditional...

so-pinyin-slugs/so-pinyin-slugs.php Passed 13 tests

The entry point to "Pinyin Slugs" version 2.3.2 is a PHP file that has certain tags in its header comment area
110 characters long description:
Transforms Simplified or Traditional Chinese character titles into Pinyin to create a permalink friendly slug.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected910 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP4114145597
PO File398188261
CSS10552

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.14
Average class complexity2.00
▷ Minimum class complexity2.00
▷ Maximum class complexity2.00
Average method complexity1.17
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods6100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.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
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/so-icon.png1.22KB1.45KB0.00%