84% safecode

Code Review | SafeCode

WordPress plugin SafeCode scored84%from 54 tests.

About plugin

  • Plugin page: safecode
  • Plugin version: 0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.7.1
  • WordPress version: 6.3.1
  • First release: Sep 27, 2012
  • Latest release: Apr 17, 2021
  • Number of updates: 26
  • Update frequency: every 120.2 days
  • Top authors: shazdeh (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /2,514 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

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

A check of server-side resources used by SafeCode
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0135.60 ▼1.69
Dashboard /wp-admin3.32 ▼0.0243.61 ▼16.00
Posts /wp-admin/edit.php3.37 ▲0.0246.43 ▼4.56
Add New Post /wp-admin/post-new.php5.90 ▲0.0280.66 ▼18.07
Media Library /wp-admin/upload.php3.24 ▲0.0233.91 ▲4.55
SafeCode /wp-admin/options-general.php?page=safecode3.2230.22

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

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

Browser metrics Passed 4 tests

Checking browser requirements for SafeCode
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲8313.26 ▼0.911.76 ▲0.1041.14 ▲0.55
Dashboard /wp-admin2,207 ▲225.91 ▲0.05104.17 ▲4.7840.44 ▼1.36
Posts /wp-admin/edit.php2,093 ▲42.04 ▲0.0539.85 ▼2.5134.42 ▼3.32
Add New Post /wp-admin/post-new.php1,536 ▲1723.36 ▲0.02655.10 ▼14.9550.33 ▼8.75
Media Library /wp-admin/upload.php1,386 ▼24.24 ▼0.04101.48 ▼0.6444.11 ▼0.51
SafeCode /wp-admin/options-general.php?page=safecode9703.2376.6441.53

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

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 take a closer look at the following
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/safecode/views/admin.php
    • > /wp-content/plugins/safecode/init.php

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 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
4 plugin tags: custom-functions, php, snippet, php-exec

safecode/init.php 92% from 13 tests

"SafeCode" version 0.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("safecode.php" instead of "init.php")

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
Everything looks great! No dangerous files found in this plugin78 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP2182365
CSS1007
JavaScript1006

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity7.00
▷ Minimum class complexity7.00
▷ Maximum class complexity7.00
Average method complexity1.86
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods685.71%
▷ Public methods7100.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 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