10% safly-cloud-protection

Code Review | SaFly Cloud Protection

WordPress plugin SaFly Cloud Protection scored10%from 54 tests.

About plugin

  • Plugin page: safly-cloud-prote...
  • Plugin version: 3.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.8
  • WordPress version: 6.3.1
  • First release: Feb 27, 2016
  • Latest release: Sep 8, 2017
  • Number of updates: 28
  • Update frequency: every 20.1 days
  • Top authors: safly (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /974 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Please fix the following installer errors
  • The plugin cannot be installed
    • > Deprecated in wp-content/plugins/safly-cloud-protection/safly-protection.php+33
    define(): Declaration of case-insensitive constants is deprecated

Server metrics [RAM: ▼1.97MB] [CPU: ▼59.12ms] Passed 4 tests

An overview of server-side resources used by SaFly Cloud Protection
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.444.37 ▼47.40
Dashboard /wp-admin2.05 ▼1.306.56 ▼55.26
Posts /wp-admin/edit.php2.05 ▼1.315.25 ▼43.00
Add New Post /wp-admin/post-new.php2.05 ▼3.846.48 ▼90.82
Media Library /wp-admin/upload.php2.05 ▼1.184.23 ▼31.64
SaFly Cloud Protection /wp-admin/options-general.php?page=safly-protection2.055.55

Server storage [IO: ▲0.06MB] [DB: ▲0.00MB] 67% from 3 tests

Input-output and database impact of this plugin
Just a few items left to fix
  • Illegal file modification found: 3 files (0.00KB) outside of "wp-content/plugins/safly-cloud-protection/" and "wp-content/uploads/"
    • (new file) wp-content/cache/safly/reset.mark
    • (new file) wp-content/cache/safly/index.html
    • (new file) wp-content/cache/safly/timelag.txt
Filesystem: 11 new files
Database: no new tables, 9 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
safly_options
safly_interact_waf
widget_recent-comments
db_upgraded
safly_guard
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by SaFly Cloud Protection
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,784 ▲2314.10 ▼0.521.66 ▼0.4738.29 ▼6.43
Dashboard /wp-admin2,196 ▲195.49 ▼0.1485.43 ▼17.2038.47 ▼6.99
Posts /wp-admin/edit.php2,107 ▲71.96 ▼0.0334.07 ▼8.9434.63 ▼4.95
Add New Post /wp-admin/post-new.php1,528 ▼021.50 ▼1.60645.37 ▼38.3558.06 ▲0.95
Media Library /wp-admin/upload.php1,404 ▲44.17 ▼0.00110.58 ▲10.1644.26 ▼2.13
SaFly Cloud Protection /wp-admin/options-general.php?page=safly-protection1,1942.0123.0681.55

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/safly-cloud-protection/safly-protection.php+33
    define(): Declaration of case-insensitive constants is deprecated
  • This plugin did not uninstall successfully, leaving 9 options in the database
    • safly_interact_waf
    • widget_recent-posts
    • safly_guard
    • widget_theysaidso_widget
    • safly_options
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=safly-protection
    • > Deprecated in wp-content/plugins/safly-cloud-protection/safly-protection.php+33
    define(): Declaration of case-insensitive constants is deprecated
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=safly-protection
    • > Notice in wp-content/plugins/safly-cloud-protection/wrapper.php+159
    Undefined variable: saflytime
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=safly-protection
    • > Notice in wp-content/plugins/safly-cloud-protection/options.php+47
    Undefined index: safly_api_signed_url
    • > GET request to /wp-admin/options-general.php?page=safly-protection
    • > Notice in wp-content/plugins/safly-cloud-protection/options.php+136
    Undefined variable: safly_if_spiders_ua_off

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
Please take a closer look at the following
  • 8× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/safly-cloud-protection/wrapper.php
    • > /wp-content/plugins/safly-cloud-protection/core/safly-guard.php
    • > /wp-content/plugins/safly-cloud-protection/initial-configuration.php
    • > /wp-content/plugins/safly-cloud-protection/options.php
    • > /wp-content/plugins/safly-cloud-protection/reset.php
    • > /wp-content/plugins/safly-cloud-protection/core/safly-interact-waf.php
    • > /wp-content/plugins/safly-cloud-protection/variables.php
    • > /wp-content/plugins/safly-cloud-protection/safly-protection.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Tags: Please reduce the number of tags, currently 19 tag instead of maximum 10
The official readme.txt might help

safly-cloud-protection/safly-protection.php 85% from 13 tests

The main PHP file in "SaFly Cloud Protection" ver. 3.1.0 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Description: Keep the plugin description shorter than 140 characters (currently 150 characters long)
  • Main file name: Name the main plugin file the same as the plugin slug ("safly-cloud-protection.php" instead of "safly-protection.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 detected729 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP985141729

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.43
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%
Functions33
▷ Named functions33100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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
There were not PNG files found in your plugin