63% site-safe

Code Review | Site Safe

WordPress plugin Site Safe scored63%from 54 tests.

About plugin

  • Plugin page: site-safe
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0.1-6.0.2
  • WordPress version: 6.3.1
  • First release: Jan 10, 2023
  • Latest release: Jan 10, 2023
  • Number of updates: 2
  • Update frequency: every 27.0 days
  • Top authors: 42techskylight (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /155 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▼0.90MB] [CPU: ▼30.77ms] Passed 4 tests

Server-side resources used by Site Safe
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0632.38 ▼6.85
Dashboard /wp-admin3.04 ▼0.2622.70 ▼25.98
Posts /wp-admin/edit.php3.04 ▼0.3224.92 ▼20.87
Add New Post /wp-admin/post-new.php3.04 ▼2.8521.02 ▼63.80
Media Library /wp-admin/upload.php3.04 ▼0.1921.70 ▼12.42
All Files /wp-admin/edit.php?post_type=wpss3.0424.20
Tags /wp-admin/edit-tags.php?taxonomy=wpss-tag&post_type=wpss3.0421.69
Settings /wp-admin/edit.php?post_type=wpss&page=wpss3.0426.28
Add-Ons /wp-admin/edit.php?post_type=wpss&page=wpss-addons3.0422.78
Categories /wp-admin/edit-tags.php?taxonomy=category&post_type=wpss3.0419.07
Add New /wp-admin/post-new.php?post_type=wpss3.0422.74

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 37 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
category_children
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Site Safe
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,930 ▲16913.35 ▼1.257.75 ▲6.0738.81 ▼7.49
Dashboard /wp-admin2,253 ▲795.59 ▼0.0689.48 ▼11.6039.17 ▼6.00
Posts /wp-admin/edit.php2,158 ▲582.06 ▲0.0541.15 ▲4.3834.24 ▲0.90
Add New Post /wp-admin/post-new.php1,572 ▲3723.25 ▲5.31684.80 ▲35.3155.09 ▼19.66
Media Library /wp-admin/upload.php1,458 ▲584.38 ▲0.1194.81 ▼9.3645.96 ▼3.34
All Files /wp-admin/edit.php?post_type=wpss1,2081.9234.5332.26
Tags /wp-admin/edit-tags.php?taxonomy=wpss-tag&post_type=wpss1,3012.1427.7228.45
Settings /wp-admin/edit.php?post_type=wpss&page=wpss8482.0225.8426.72
Add-Ons /wp-admin/edit.php?post_type=wpss&page=wpss-addons8342.0226.0526.28
Categories /wp-admin/edit-tags.php?taxonomy=category&post_type=wpss1,5072.1827.5931.74
Add New /wp-admin/post-new.php?post_type=wpss2,8207.96170.6865.34

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Uninstall procedure had uncaught errors
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • category_children
    • db_upgraded
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These errors were triggered by the plugin
  • 26 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=wpss
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
    • > GET request to /wp-admin/post-new.php?post_type=wpss
    • > Notice in wp-content/plugins/site-safe/includes/class-site-safe.php+263
    Trying to get property 'post_type' of non-object

SRP 0% 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 items
  • 7× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/site-safe/includes/upload.widget.php
    • > /wp-content/plugins/site-safe/public/partials/site-safe-public-display.php
    • > /wp-content/plugins/site-safe/includes/pages/upload.php
    • > /wp-content/plugins/site-safe/includes/pages/includes/settings-tabs.php
    • > /wp-content/plugins/site-safe/admin/partials/site-safe-admin-display.php
    • > /wp-content/plugins/site-safe/includes/ajax/upload.php
    • > /wp-content/plugins/site-safe/includes/pages-addons/includes/tabs.php
  • 10× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function sanitize_text_field() in wp-content/plugins/site-safe/includes/ajax/preview.php:3
    • > PHP Notice
      Undefined variable: tab in wp-content/plugins/site-safe/includes/pages-addons/includes/tabs.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/site-safe/includes/template.php:3
    • > PHP Notice
      Undefined index: file in wp-content/plugins/site-safe/includes/ajax/upload.php on line 6
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/site-safe/includes/ajax/upload.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function sanitize_text_field() in wp-content/plugins/site-safe/includes/pages/settings-sync.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function sanitize_text_field() in wp-content/plugins/site-safe/includes/pages-addons/index.php:2
    • > PHP Notice
      Undefined variable: tab in wp-content/plugins/site-safe/includes/pages-addons/includes/tabs.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function sanitize_text_field() in wp-content/plugins/site-safe/includes/pages/index.php:2
    • > PHP Notice
      Undefined variable: tab in wp-content/plugins/site-safe/includes/pages/includes/settings-tabs.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
6 plugin tags: download, privacy, safe, nft, upload...

site-safe/site-safe.php Passed 13 tests

The principal PHP file in "Site Safe" v. 1.0.0 is loaded by WordPress automatically on each request
78 characters long description:
Site Safe plugin is the easiest way to secure All Media Files and NFT uploads.

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 plugin803 lines of code in 29 files:
LanguageFilesBlank linesComment linesLines of code
PHP25289584619
JavaScript26153109
CSS2211375

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity4.43
▷ Minimum class complexity1.00
▷ Maximum class complexity23.00
Average method complexity1.35
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods28
▷ Static methods310.71%
▷ Public methods2382.14%
▷ Protected methods00.00%
▷ Private methods517.86%
Functions14
▷ Named functions535.71%
▷ Anonymous functions964.29%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/icons/ext/pdf.png16.91KB4.57KB▼ 72.96%
includes/icons/ext/no-preview.png3.66KB3.68KB0.00%