78% text-moderation-system

Code Review | 腾讯云 T-Sec 天御

WordPress plugin 腾讯云 T-Sec 天御 scored78%from 54 tests.

About plugin

  • Plugin page: text-moderation-s...
  • Plugin version: 1.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5.0-5.4
  • WordPress version: 6.3.1
  • First release: Apr 15, 2020
  • Latest release: Apr 15, 2020
  • Number of updates: 6
  • Update frequency: N/A
  • Top authors: xutongle (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /572 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

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

An overview of server-side resources used by 腾讯云 T-Sec 天御
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0138.85 ▲0.72
Dashboard /wp-admin3.31 ▲0.0142.94 ▼10.61
Posts /wp-admin/edit.php3.36 ▲0.0148.47 ▲0.76
Add New Post /wp-admin/post-new.php5.89 ▲0.0187.51 ▼5.52
Media Library /wp-admin/upload.php3.24 ▲0.0146.12 ▲13.39

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 175 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
censor_options
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

腾讯云 T-Sec 天御: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,816 ▲5914.45 ▲0.161.62 ▼0.3541.62 ▼1.40
Dashboard /wp-admin2,222 ▲344.85 ▼0.03107.78 ▼4.1545.15 ▼0.09
Posts /wp-admin/edit.php2,105 ▲132.00 ▲0.0239.04 ▼3.1940.58 ▲2.49
Add New Post /wp-admin/post-new.php1,547 ▲3023.07 ▲5.56591.43 ▼17.9056.92 ▼2.91
Media Library /wp-admin/upload.php1,407 ▲194.21 ▼0.0994.89 ▼2.6847.86 ▲7.40

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_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/text-moderation-system/censor.php
  • 83× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Exception\\GuzzleException' not found in wp-content/plugins/text-moderation-system/vendor/guzzlehttp/guzzle/src/Exception/InvalidArgumentException.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Promise\\RejectionException' not found in wp-content/plugins/text-moderation-system/vendor/guzzlehttp/promises/src/AggregateException.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/text-moderation-system/vendor/guzzlehttp/psr7/src/LazyOpenStream.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Handler\\CurlFactoryInterface' not found in wp-content/plugins/text-moderation-system/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:15
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\RequestInterface' not found in wp-content/plugins/text-moderation-system/vendor/guzzlehttp/psr7/src/Request.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'TencentCloud\\Common\\AbstractModel' not found in wp-content/plugins/text-moderation-system/vendor/tencentcloud/tencentcloud-sdk-php/src/TencentCloud/Cms/V20190321/Models/ImageData.php:60
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Exception\\TransferException' not found in wp-content/plugins/text-moderation-system/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'TencentCloud\\Common\\AbstractModel' not found in wp-content/plugins/text-moderation-system/vendor/tencentcloud/tencentcloud-sdk-php/src/TencentCloud/Cms/V20190321/Models/FileSampleInfo.php:66
    • > PHP Fatal error
      Uncaught Error: Class 'TencentCloud\\Common\\AbstractModel' not found in wp-content/plugins/text-moderation-system/vendor/tencentcloud/tencentcloud-sdk-php/src/TencentCloud/Cms/V20190321/Models/Filter.php:28
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/text-moderation-system/censor_actions.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
3 plugin tags: censor, t-sec, spam

text-moderation-system/censor.php 85% from 13 tests

The main file in "腾讯云 T-Sec 天御" v. 1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 205 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("text-moderation-system.php" instead of "censor.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin28,627 lines of code in 165 files:
LanguageFilesBlank linesComment linesLines of code
Markdown1111,753017,577
PHP1442,2007,50710,430
JSON800601
Dockerfile18010
make1409

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.49
Average class complexity11.98
▷ Minimum class complexity1.00
▷ Maximum class complexity84.00
Average method complexity2.89
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces14
Interfaces15
Traits2
Classes111
▷ Abstract classes21.80%
▷ Concrete classes10998.20%
▷ Final classes98.26%
Methods783
▷ Static methods698.81%
▷ Public methods65083.01%
▷ Protected methods50.64%
▷ Private methods12816.35%
Functions152
▷ Named functions6542.76%
▷ Anonymous functions8757.24%
Constants57
▷ Global constants23.51%
▷ Class constants5596.49%
▷ Public constants55100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
PNG images were not found in this plugin