74% blocked-in-china

Code Review | Blocked in China | Check if your site is available in the Chinese mainland

WordPress plugin Blocked in China | Check if your site is available in the Chinese mainland scored74%from 54 tests.

About plugin

  • Plugin page: blocked-in-china
  • Plugin version: 1.0.6
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.1-6.3
  • WordPress version: 6.3.1
  • First release: Jul 17, 2020
  • Latest release: Jul 12, 2023
  • Number of updates: 33
  • Update frequency: every 33.0 days
  • Top authors: victoralbala (42.42%)brandonfire (36.36%)juanobrach (27.27%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,385 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲5.36MB] [CPU: ▲29.32ms] 75% from 4 tests

An overview of server-side resources used by Blocked in China | Check if your site is available in the Chinese mainland
Please fix the following
  • Extra RAM: Extra memory usage should kept under 5MB (currently 5.36MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /9.19 ▲5.7378.39 ▲34.75
Dashboard /wp-admin9.21 ▲5.9188.52 ▲36.19
Posts /wp-admin/edit.php9.21 ▲5.8579.30 ▲28.57
Add New Post /wp-admin/post-new.php9.85 ▲3.97131.52 ▲21.34
Media Library /wp-admin/upload.php9.21 ▲5.9868.89 ▲32.62
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius9.2166.17

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Blocked in China | Check if your site is available in the Chinese mainland
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,859 ▲11314.74 ▲0.072.13 ▲0.2731.54 ▼13.83
Dashboard /wp-admin2,237 ▲465.83 ▲0.95109.72 ▼10.3247.24 ▲2.18
Posts /wp-admin/edit.php2,123 ▲342.04 ▲0.0536.65 ▼1.4135.25 ▼2.29
Add New Post /wp-admin/post-new.php1,532 ▼1017.48 ▼0.71620.69 ▼50.9663.37 ▼1.59
Media Library /wp-admin/upload.php1,422 ▲344.23 ▲0.05102.48 ▼8.5145.28 ▼5.24
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,0661.6927.6227.81

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/blocked-in-china/freemius/includes/class-freemius.php+8486
    Undefined property: stdClass::$plugins
  • Zombie WordPress options were found after uninstall: 9 options
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • fs_accounts
    • widget_recent-comments
    • fs_debug_mode
    • can_compress_scripts
    • db_upgraded
    • fs_active_plugins

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
Almost there! Just fix the following items
  • 5× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/blocked-in-china/admin/templates/log.php:3
    • > PHP Fatal error
      Uncaught Error: Call to a member function is_plan() on null in wp-content/plugins/blocked-in-china/admin/templates/schedule.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/blocked-in-china/admin/templates/bundle.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/blocked-in-china/admin/class-admin-controller.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/blocked-in-china/admin/templates/form.php:3

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 describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
10 plugin tags: detect, firewall, status, blocked, vpn...

blocked-in-china/blocked-in-china.php Passed 13 tests

The main PHP file in "Blocked in China | Check if your site is available in the Chinese mainland" ver. 1.0.6 adds more information about the plugin and also serves as the entry point for this plugin
72 characters long description:
Run status checks to see if your website is available in mainland China.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin34,882 lines of code in 144 files:
LanguageFilesBlank linesComment linesLines of code
PHP1238,14417,23633,856
SVG202627
JavaScript56298351
CSS146048

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
It is recommended to fix the following
  • Cyclomatic complexity of classes should be reduced to less than 1000 (currently 3,073)
Cyclomatic complexity
Average complexity per logical line of code0.63
Average class complexity91.98
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity4.59
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes49
▷ Abstract classes24.08%
▷ Concrete classes4795.92%
▷ Final classes00.00%
Methods1,271
▷ Static methods19715.50%
▷ Public methods88269.39%
▷ Protected methods171.34%
▷ Private methods37229.27%
Functions109
▷ Named functions109100.00%
▷ Anonymous functions00.00%
Constants148
▷ Global constants10168.24%
▷ Class constants4731.76%
▷ Public constants47100.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
15 PNG files occupy 0.15MB with 0.07MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/includes/freemius-pricing/dd89563360f0272635c8f0ab7d7f1402.png11.80KB3.94KB▼ 66.64%
freemius/includes/freemius-pricing/c03f665db27af43971565560adfba594.png6.06KB3.01KB▼ 50.27%
freemius/includes/freemius-pricing/5480ed23b199531a8cbc05924f26952b.png7.09KB2.94KB▼ 58.58%
assets/images/icon-sic.png5.95KB4.57KB▼ 23.25%
freemius/includes/freemius-pricing/178afa6030e76635dbe835e111d2c507.png5.88KB3.01KB▼ 48.84%