84% gongan-beian

Code Review | 公安备案

WordPress plugin 公安备案 scored84%from 54 tests.

About plugin

  • Plugin page: gongan-beian
  • Plugin version: 1.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-4.9.7
  • WordPress version: 6.3.1
  • First release: Jul 26, 2018
  • Latest release: Jul 26, 2018
  • Number of updates: 3
  • Update frequency: every 0.3 days
  • Top authors: yangjingwen (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /2,088 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

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

A check of server-side resources used by 公安备案
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0137.58 ▼1.61
Dashboard /wp-admin3.31 ▲0.0148.09 ▲2.25
Posts /wp-admin/edit.php3.36 ▲0.0146.07 ▼2.76
Add New Post /wp-admin/post-new.php5.89 ▲0.0192.49 ▼8.75
Media Library /wp-admin/upload.php3.24 ▲0.0135.70 ▲0.97

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for 公安备案
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,803 ▲6813.20 ▼1.191.73 ▼0.0342.30 ▲0.05
Dashboard /wp-admin2,209 ▲215.80 ▲0.9397.88 ▼9.2440.97 ▼3.35
Posts /wp-admin/edit.php2,095 ▲32.00 ▼0.0437.90 ▼5.7135.35 ▼1.11
Add New Post /wp-admin/post-new.php1,531 ▼223.25 ▲0.08589.49 ▼37.3354.82 ▲2.05
Media Library /wp-admin/upload.php1,385 ▼34.18 ▼0.0694.37 ▼1.5240.47 ▼5.10

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 were found after uninstall: 6 options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

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
The following issues need your attention
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/gongan-beian/gonganbeian.php:29

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
1 plugin tags: ip

gongan-beian/gonganbeian.php 85% from 13 tests

This is the main PHP file of "公安备案" version 1.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 177 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("gongan-beian.php" instead of "gonganbeian.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin27 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP154427

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.10
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%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected