84% csp-antsst

Code Review | CSP-ANTS&ST

WordPress plugin CSP-ANTS&ST scored84%from 54 tests.

About plugin

  • Plugin page: csp-antsst
  • Plugin version: 1.1.1
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.9-5.9
  • WordPress version: 6.3.1
  • First release: Apr 21, 2022
  • Latest release: Apr 22, 2022
  • Number of updates: 7
  • Update frequency: every 0.1 days
  • Top authors: pcescato (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

90+ active /699 total downloads

Benchmarks

Plugin footprint 83% 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: ▲0.02MB] [CPU: ▼4.97ms] Passed 4 tests

Server-side resources used by CSP-ANTS&ST
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0539.78 ▼1.02
Dashboard /wp-admin3.33 ▲0.0345.09 ▼1.13
Posts /wp-admin/edit.php3.38 ▲0.0243.59 ▼1.39
Add New Post /wp-admin/post-new.php5.91 ▲0.0281.70 ▼16.33
Media Library /wp-admin/upload.php3.25 ▲0.0236.10 ▲2.78

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 3 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
widget_recent-posts
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for CSP-ANTS&ST
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲7913.33 ▼1.055.34 ▲3.5937.61 ▼2.31
Dashboard /wp-admin2,203 ▲155.77 ▼0.1293.99 ▼7.2540.25 ▼5.10
Posts /wp-admin/edit.php2,086 ▼32.01 ▲0.0034.24 ▲0.3334.65 ▲0.22
Add New Post /wp-admin/post-new.php1,542 ▲1423.11 ▲4.75652.95 ▲16.8765.42 ▲14.99
Media Library /wp-admin/upload.php1,385 ▼34.19 ▲0.0397.57 ▼4.2343.17 ▼3.81

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
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

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
Almost there! Just fix the following items
  • 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/csp-antsst/csp-add-nonces-to-script-and-style-tags.php:52

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 errors were detected

Optimizations

Plugin configuration 93% from 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
5 plugin tags: content-security-policy, nonces, csp, security headers, sha256 hashes

csp-antsst/csp-add-nonces-to-script-and-style-tags.php 85% from 13 tests

The main file in "CSP-ANTS&ST" v. 1.1.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Requires at least: The required version number must match the one declared in readme.txt ("5.0" instead of "5.9")
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("csp-antsst.php" instead of "csp-add-nonces-to-script-and-style-tags.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin83 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1341383

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.19
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%
Functions12
▷ Named functions325.00%
▷ Anonymous functions975.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
PNG images were not found in this plugin