10% strings-sanitizer

Code Review | Strings Sanitizer

WordPress plugin Strings Sanitizer scored10%from 54 tests.

About plugin

  • Plugin page: strings-sanitizer
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.7+
  • WordPress version: 6.3.1
  • First release: Apr 12, 2012
  • Latest release: Sep 24, 2012
  • Number of updates: 20
  • Update frequency: every 8.3 days
  • Top authors: prospek (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active /3,494 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
These installer errors require your attention
  • This plugin did not install gracefully
    • > Notice in wp-content/plugins/strings-sanitizer/init.php+45
    Undefined variable: wp_version

Server metrics [RAM: ▼1.80MB] [CPU: ▼50.37ms] Passed 4 tests

This is a short check of server-side resources used by Strings Sanitizer
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.18 ▼1.286.64 ▼34.71
Dashboard /wp-admin2.20 ▼1.107.96 ▼41.64
Posts /wp-admin/edit.php2.20 ▼1.156.99 ▼40.07
Add New Post /wp-admin/post-new.php2.20 ▼3.688.89 ▼85.05
Media Library /wp-admin/upload.php2.20 ▼1.026.93 ▼28.39
Strings Sanitizer /wp-admin/admin.php?page=prospek-strings-sanitizer2.209.68

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Strings Sanitizer
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,874 ▲13913.30 ▼0.991.47 ▼0.2941.59 ▼3.74
Dashboard /wp-admin2,277 ▲914.95 ▼0.08118.24 ▼31.0281.38 ▲34.00
Posts /wp-admin/edit.php2,166 ▲772.34 ▲0.3049.82 ▲14.3942.17 ▲4.94
Add New Post /wp-admin/post-new.php1,550 ▲2017.57 ▼0.73718.15 ▲47.6458.74 ▼2.24
Media Library /wp-admin/upload.php1,459 ▲714.33 ▲0.13130.10 ▲33.5450.57 ▲8.72
Strings Sanitizer /wp-admin/admin.php?page=prospek-strings-sanitizer9171.8943.4151.69

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • Uninstall procedure validation failed for this plugin
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the prospek-strings-sanitizer handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/admin.php?page=prospek-strings-sanitizer
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the prospek-strings-sanitizer handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
    • > GET request to /wp-admin/admin.php?page=prospek-strings-sanitizer
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the bootstrap-buttons handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
    • > GET request to /wp-admin/admin.php?page=prospek-strings-sanitizer
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the fontawesome-webfonts handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=prospek-strings-sanitizer
    • > Notice in wp-content/plugins/strings-sanitizer/classes/admin_pointers.php+137
    Array to string conversion

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
The following issues need your attention
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/strings-sanitizer/views/index.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/strings-sanitizer/core.php:127

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please fix the following user-side errors
    • > GET request to /wp-admin/admin.php?page=prospek-strings-sanitizer
    • > Console-api (warning) in wp-admin/js/common.min.js?ver=6.3.1+1:283
    wpPointerL10n.dismiss is deprecated since version 5.5.0! Use wp.i18n instead.

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need your attention:
  • Tags: Too many tags (18 tag instead of maximum 10); only the first 5 tags are used in your directory listing
  • Tested up to: The plugin version is formatted incorrectly
You can look at the official readme.txt

strings-sanitizer/init.php 85% from 13 tests

The main PHP file in "Strings Sanitizer" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("strings-sanitizer.php" instead of "init.php")
  • Description: The description should be shorter than 140 characters (currently 231 characters long)

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
Good job! No executable or dangerous file extensions detected1,558 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
CSS44018791
PHP6136431503
SVG100175
PO File2255181
HTML1208

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity20.67
▷ Minimum class complexity12.00
▷ Maximum class complexity28.00
Average method complexity3.27
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods26
▷ Static methods519.23%
▷ Public methods2076.92%
▷ Protected methods00.00%
▷ Private methods623.08%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
4 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/pointer/pointer.png2.04KB0.72KB▼ 64.51%
assets/images/wp-icon-x16.png1.23KB0.39KB▼ 68.39%
assets/images/wp-icon-x32.png1.37KB0.54KB▼ 60.80%
assets/images/pointer/icon.png1.57KB0.58KB▼ 63.26%