10% sensitive-chinese-words-scanner

Code Review | The Great Firewords of China

WordPress plugin The Great Firewords of China scored10%from 54 tests.

About plugin

  • Plugin page: sensitive-chinese...
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Aug 30, 2017
  • Latest release: Apr 3, 2020
  • Number of updates: 87
  • Update frequency: every 10.9 days
  • Top authors: studiohyperset (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /995 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Please fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Warning in wp-includes/class-wp-hook.php+312
    call_user_func_array() expects parameter 1 to be a valid callback, function 'cyb_activation_redirect' not found or invalid function name

Server metrics [RAM: ▲0.22MB] [CPU: ▼7.02ms] Passed 4 tests

A check of server-side resources used by The Great Firewords of China
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.67 ▲0.2043.41 ▲2.47
Dashboard /wp-admin3.55 ▲0.2054.19 ▼14.59
Posts /wp-admin/edit.php3.66 ▲0.3051.11 ▲0.93
Add New Post /wp-admin/post-new.php6.13 ▲0.2490.15 ▼16.88
Media Library /wp-admin/upload.php3.47 ▲0.2439.81 ▲3.89
Overview /wp-admin/admin.php?page=scws_options3.4336.42
Active Scans /wp-admin/admin.php?page=scws_active_scan3.4332.89
File Scan /wp-admin/admin.php?page=scws_file_scan3.4332.84
Database Scan /wp-admin/admin.php?page=scws_db_scan3.4334.86

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

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

Browser metrics Passed 4 tests

The Great Firewords of China: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,833 ▲8713.21 ▼1.171.70 ▼0.0442.16 ▼4.71
Dashboard /wp-admin2,242 ▲544.83 ▼0.0399.24 ▼10.5042.46 ▼2.48
Posts /wp-admin/edit.php2,122 ▲302.00 ▼0.0336.04 ▼1.3837.17 ▲2.55
Add New Post /wp-admin/post-new.php1,544 ▲2523.18 ▼0.03664.56 ▼12.0849.52 ▼3.18
Media Library /wp-admin/upload.php1,424 ▲394.11 ▼0.10110.56 ▲1.1350.40 ▲3.28
Overview /wp-admin/admin.php?page=scws_options1,0439.08252.2285.16
Active Scans /wp-admin/admin.php?page=scws_active_scan1,0458.94243.7848.53
File Scan /wp-admin/admin.php?page=scws_file_scan1,0428.86215.5163.15
Database Scan /wp-admin/admin.php?page=scws_db_scan1,0438.94242.4457.25

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

Smoke tests 50% 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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 7× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/sensitive-chinese-words-scanner/include/ui.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sensitive-chinese-words-scanner/include/active-scan.php:154
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sensitive-chinese-words-scanner/ajax/db-scan.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/sensitive-chinese-words-scanner/include/editor.php:23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/sensitive-chinese-words-scanner/sensitive-chinese-words-scanner.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sensitive-chinese-words-scanner/ajax/file-scan.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sensitive-chinese-words-scanner/ajax/options.php:6

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There are user-side issues you should fix
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=scws_db_scan
    • > Console-api (severe) in unknown
    https://app.hubspot.com/embedded-viral-link/forms?lang=en&portalId=4542224&hubs_id=forms-branding-control&hubs_source=wp.com&intent=marketingFreeForms 0:2408 "No CSRF Cookie found."
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=scws_db_scan
    • > Console-api (severe) in unknown
    https://app.hubspot.com/embedded-viral-link/forms?lang=en&portalId=4542224&hubs_id=forms-branding-control&hubs_source=wp.com&intent=marketingFreeForms 6:2354 "No CSRF Cookie found."
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=scws_db_scan
    • > Network (severe)
    https://app.hubspot.com/api/login-verify/hub-user-info?early=true&hs_static_app=embedded-viral-link-ui&hs_static_app_version=1.167&clienttimeout=3000 - Failed to load resource: the server responded with a status of 401 ()

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Requires at least: The plugin version is formatted incorrectly
  • Screenshots: Please add images for these screenshots: #1 (Overview gfw-3.png), #2 (Database Scan gfw-4.png), #3 (File Scan gfw-1.png), #4 (Active Scan gfw-2.png)
You can look at the official readme.txt

sensitive-chinese-words-scanner/sensitive-chinese-words-scanner.php 85% from 13 tests

The primary PHP file in "The Great Firewords of China" version 1.2 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Description: Keep the plugin description shorter than 140 characters (currently 310 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin1,892 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP114952881,264
CSS100306
LESS1330205
HTML2351096
Markdown113021

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.39
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%
Functions31
▷ Named functions31100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG images were found in this plugin