84% textcensor-for-articles

Code Review | TextCensor For Articles

WordPress plugin TextCensor For Articles scored84%from 54 tests.

About plugin

  • Plugin page: textcensor-for-ar...
  • Plugin version: 1.1.2
  • PHP compatiblity: 5.6.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2-6.3
  • WordPress version: 6.3.1
  • First release: Mar 10, 2020
  • Latest release: Jul 22, 2023
  • Number of updates: 11
  • Update frequency: every 111.7 days
  • Top authors: shenyanzhi (100%)

Code review

54 tests

User reviews

1 review

Install metrics

300+ active /1,557 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼2.69ms] Passed 4 tests

A check of server-side resources used by TextCensor For Articles
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0344.41 ▲3.43
Dashboard /wp-admin3.38 ▲0.0350.76 ▲0.80
Posts /wp-admin/edit.php3.43 ▲0.0350.96 ▲3.63
Add New Post /wp-admin/post-new.php5.96 ▲0.0394.21 ▼16.57
Media Library /wp-admin/upload.php3.30 ▲0.0337.96 ▲1.58
文章内容审核设置 /wp-admin/options-general.php?page=TextCensor_For_Articles3.2733.90

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 8 new files
Database: no new tables, 7 new options
New WordPress options
TextCensorForArticles
widget_recent-posts
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for TextCensor For Articles
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.40 ▼0.361.84 ▼0.0746.74 ▲2.43
Dashboard /wp-admin2,199 ▲225.61 ▼0.0687.21 ▼3.0547.29 ▲3.45
Posts /wp-admin/edit.php2,104 ▲11.99 ▲0.0234.84 ▼1.4738.05 ▲3.04
Add New Post /wp-admin/post-new.php1,530 ▲423.06 ▼0.10661.84 ▼11.8258.78 ▲4.45
Media Library /wp-admin/upload.php1,398 ▼54.18 ▼0.0195.55 ▼2.0246.11 ▼0.61
文章内容审核设置 /wp-admin/options-general.php?page=TextCensor_For_Articles8471.9922.7965.67

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/textcensor-for-articles/textcensor-for-articles.php:13

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 issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Screenshots: Screenshot #1 (screenshot-1.png) image required
Please take inspiration from this readme.txt

textcensor-for-articles/textcensor-for-articles.php Passed 13 tests

Analyzing the main PHP file in "TextCensor For Articles" version 1.1.2
69 characters long description:
基于百度文本审核技术来提供WordPress文章内容审核。

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 plugin321 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP342100304
Markdown116017

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity24.00
▷ Minimum class complexity24.00
▷ Maximum class complexity24.00
Average method complexity3.30
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods10
▷ Static methods00.00%
▷ Public methods330.00%
▷ Protected methods330.00%
▷ Private methods440.00%
Functions8
▷ Named functions8100.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
1 PNG file occupies 0.19MB with 0.13MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png196.24KB60.10KB▼ 69.37%