90% ai-shield

Code Review | AI Shield

WordPress plugin AI Shield scored90%from 54 tests.

About plugin

  • Plugin page: ai-shield
  • Plugin version: 1.0.3
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6.10-6.4
  • WordPress version: 6.3.1
  • First release: Nov 22, 2023
  • Latest release: Nov 23, 2023
  • Number of updates: 6
  • Update frequency: every 0.3 days
  • Top authors: kinggmobb (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /34 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.11MB] [CPU: ▼3.96ms] Passed 4 tests

Server-side resources used by AI Shield
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1245.41 ▲0.87
Dashboard /wp-admin3.41 ▲0.1046.89 ▼7.67
Posts /wp-admin/edit.php3.52 ▲0.1648.39 ▲0.07
Add New Post /wp-admin/post-new.php6.01 ▲0.1291.91 ▼9.09
Media Library /wp-admin/upload.php3.33 ▲0.1037.46 ▲3.07
AI Shield /wp-admin/options-general.php?page=ai_shield3.3030.88

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 18 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
ai_shield
widget_theysaidso_widget
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by AI Shield
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,798 ▲3614.67 ▲0.081.64 ▲0.0437.21 ▼4.71
Dashboard /wp-admin2,203 ▲255.58 ▲0.0195.96 ▼18.0145.49 ▲2.63
Posts /wp-admin/edit.php2,111 ▲111.95 ▲0.0138.54 ▲1.6935.83 ▲1.67
Add New Post /wp-admin/post-new.php1,533 ▲723.19 ▲0.35664.63 ▲63.1352.03 ▲9.03
Media Library /wp-admin/upload.php1,408 ▲84.17 ▼0.0398.03 ▼1.4842.90 ▼1.06
AI Shield /wp-admin/options-general.php?page=ai_shield8502.0026.7725.36

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
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests Passed 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 Passed 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
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
4 plugin tags: chatgpt, ai, gpt, openai

ai-shield/ai-shield.php 92% from 13 tests

This is the main PHP file of "AI Shield" version 1.0.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 145 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin361 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP11171548361
CSS2020
JavaScript1010

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity3.71
▷ Minimum class complexity1.00
▷ Maximum class complexity12.00
Average method complexity1.53
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods33
▷ Static methods26.06%
▷ Public methods2781.82%
▷ Protected methods00.00%
▷ Private methods618.18%
Functions5
▷ Named functions360.00%
▷ Anonymous functions240.00%
Constants4
▷ Global constants250.00%
▷ Class constants250.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

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