94% s2-safety-functions

Code Review | s2 Safety

WordPress plugin s2 Safety scored 94% from 53 tests.

About plugin

  • Plugin page: s2-safety-functions
  • Plugin version: 1.9.2
  • PHP compatiblity: 5.2.17+
  • PHP version: 7.4.16
  • WordPress version: 5.8.1
  • First release: Apr 29, 2020
  • Latest release: May 10, 2021
  • Number of updates: 9
  • Update frequency: every 41.8 days
  • Top authors: Sebas2 (100%)

Code review

53 tests

User reviews

1 review

Install metrics

10+ active / 208 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

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

An overview of server-side resources used by s2 Safety
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.1336.00 ▲17.07
Dashboard /wp-admin3.07 ▲0.0142.82 ▲0.12
Posts /wp-admin/edit.php3.12 ▲0.0141.84 ▲6.68
Add New Post /wp-admin/post-new.php5.43 ▲0.0089.37 ▼1,115.02
Media Library /wp-admin/upload.php3.01 ▲0.0032.11 ▼6.57

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 3 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

s2 Safety: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,649 ▲6716.01 ▲0.089.04 ▲0.7546.71 ▼3.02
Dashboard /wp-admin2,927 ▲775.91 ▲0.11137.86 ▲2.04101.54 ▼5.90
Posts /wp-admin/edit.php2,703 ▼32.69 ▲0.0165.35 ▼2.6086.14 ▼9.60
Add New Post /wp-admin/post-new.php1,853 ▲20018.82 ▲0.02364.69 ▲1.31116.62 ▲11.05
Media Library /wp-admin/upload.php1,772 ▼05.01 ▲0.01142.89 ▼8.87109.55 ▼10.25

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

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

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
Please fix the following
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/s2-safety-functions/s2_safety.php:14

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that require attention:
  • Requires at least: The plugin version is formatted incorrectly
Please take inspiration from this readme.txt

s2-safety-functions/s2_safety.php 92% from 13 tests

The main PHP file in "s2 Safety" ver. 1.9.2 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("s2-safety-functions.php" instead of "s2_safety.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected37 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP283537

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.05
Average class complexity2.00
▷ Minimum class complexity2.00
▷ Maximum class complexity2.00
Average method complexity1.25
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods125.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 1 test

Image compression Passed 1 test

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