84% sync-hacpai

Code Review | sync-hacpai

WordPress plugin sync-hacpai scored 84% from 54 tests.

About plugin

  • Plugin page: sync-hacpai
  • Plugin version: 1.40
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1-4.9.9
  • WordPress version: 6.3.1
  • First release: Mar 21, 2019
  • Latest release: Mar 21, 2019
  • Number of updates: 3
  • Update frequency: every 0.3 days
  • Top authors: zhaofengshu33 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 458 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.05MB] [CPU: ▼4.15ms] Passed 4 tests

Analyzing server-side resources used by sync-hacpai
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0537.43 ▼8.48
Dashboard /wp-admin3.35 ▲0.0547.03 ▼4.43
Posts /wp-admin/edit.php3.40 ▲0.0549.97 ▲0.49
Add New Post /wp-admin/post-new.php5.93 ▲0.0594.21 ▼4.17
Media Library /wp-admin/upload.php3.27 ▲0.0541.46 ▲10.20

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for sync-hacpai
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲8013.64 ▼0.741.74 ▲0.0139.04 ▼10.91
Dashboard /wp-admin2,218 ▲275.84 ▲0.94105.56 ▲6.4769.20 ▲26.08
Posts /wp-admin/edit.php2,104 ▲152.00 ▼0.0338.59 ▲1.0438.24 ▲1.26
Add New Post /wp-admin/post-new.php1,539 ▲1923.25 ▼0.18694.26 ▲21.2154.16 ▼3.37
Media Library /wp-admin/upload.php1,397 ▲94.19 ▼0.0598.55 ▼5.7468.89 ▲23.01

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 50% from 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
Please fix the following
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sync-hacpai/setting.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 93% 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
Please fix the following attributes:
  • Plugin Name: You should set the name of your plugin on the first line ( === sync-hacpai === )
The official readme.txt might help

sync-hacpai/index.php 92% from 13 tests

This is the main PHP file of "sync-hacpai" version 1.40, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("sync-hacpai.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
There were no executable files found in this plugin248 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP22436248

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity1.00
▷ Minimum class complexity1.00
▷ Maximum class complexity1.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/icon.png1.67KB0.60KB▼ 64.02%
images/logo.png15.00KB6.79KB▼ 54.73%