73% salt-shaker

Code Review | Salt Shaker

WordPress plugin Salt Shaker scored73%from 54 tests.

About plugin

  • Plugin page: salt-shaker
  • Plugin version: 1.4.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.4
  • WordPress version: 6.3.1
  • First release: Oct 17, 2016
  • Latest release: Oct 26, 2023
  • Number of updates: 35
  • Update frequency: every 73.3 days
  • Top authors: Nagdy (100%)

Code review

54 tests

User reviews

25 reviews

Install metrics

10,000+ active /132,603 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.54MB] [CPU: ▲1.22ms] Passed 4 tests

Analyzing server-side resources used by Salt Shaker
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.06 ▲0.6039.37 ▲1.38
Dashboard /wp-admin3.90 ▲0.6049.07 ▲1.01
Posts /wp-admin/edit.php3.95 ▲0.6052.10 ▲6.17
Add New Post /wp-admin/post-new.php6.44 ▲0.5593.65 ▼3.70
Media Library /wp-admin/upload.php3.66 ▲0.4342.89 ▲11.61
Salt Shaker /wp-admin/tools.php?page=salt_shaker3.8940.18
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius3.9938.68

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 211 new files
Database: no new tables, 9 new options
New WordPress options
widget_theysaidso_widget
fs_debug_mode
fs_active_plugins
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
db_upgraded
can_compress_scripts
fs_accounts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Salt Shaker
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,855 ▲9414.29 ▲0.001.66 ▲0.0829.90 ▼14.08
Dashboard /wp-admin2,261 ▲875.59 ▼0.1292.05 ▲1.3646.53 ▲3.42
Posts /wp-admin/edit.php2,167 ▲672.15 ▲0.1239.39 ▲3.8841.23 ▲6.22
Add New Post /wp-admin/post-new.php1,564 ▲2623.37 ▲0.10681.12 ▲14.7958.45 ▼2.96
Media Library /wp-admin/upload.php1,469 ▲694.26 ▲0.0899.65 ▲3.9847.17 ▲5.32
Salt Shaker /wp-admin/tools.php?page=salt_shaker9881.6826.7660.17
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,0771.7125.7729.52

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/salt-shaker/freemius/includes/class-freemius.php+8486
    Undefined property: stdClass::$plugins
  • This plugin did not uninstall successfully, leaving 9 options in the database
    • fs_accounts
    • widget_recent-posts
    • theysaidso_admin_options
    • fs_active_plugins
    • fs_debug_mode
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts

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
Everything seems fine, however this is by no means an exhaustive test

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 fix the following
  • 4× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/salt-shaker/_inc/loader.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'SalterCore' not found in wp-content/plugins/salt-shaker/_inc/salter.class.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/salt-shaker/_inc/gui/settings-template.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'SaltShaker\\SalterOptions' not found in wp-content/plugins/salt-shaker/_inc/gui/inner-settings-template.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
8 plugin tags: authentication keys, login, salt keys, cookies, wp config...

salt-shaker/shaker.php 92% from 13 tests

The main file in "Salt Shaker" v. 1.4.3 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("salt-shaker.php" instead of "shaker.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin34,411 lines of code in 153 files:
LanguageFilesBlank linesComment linesLines of code
PHP1268,07417,28233,448
XML500334
JavaScript43560239
Markdown2710217
PO File2283890
CSS1412083

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
It is recommended to fix the following
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 3,073)
Cyclomatic complexity
Average complexity per logical line of code0.63
Average class complexity88.25
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity4.55
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes51
▷ Abstract classes23.92%
▷ Concrete classes4996.08%
▷ Final classes00.00%
Methods1,281
▷ Static methods20415.93%
▷ Public methods89269.63%
▷ Protected methods171.33%
▷ Private methods37229.04%
Functions103
▷ Named functions103100.00%
▷ Anonymous functions00.00%
Constants146
▷ Global constants9967.81%
▷ Class constants4732.19%
▷ Public constants47100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
14 PNG files occupy 0.89MB with 0.45MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.png46.99KB15.72KB▼ 66.56%
assets/banner-1880x609-rtl.png171.92KB105.59KB▼ 38.58%
assets/banner-1544x500.png147.59KB85.89KB▼ 41.81%
assets/banner-1544x500-rtl.png151.04KB85.08KB▼ 43.67%
assets/icon-128.png14.93KB5.68KB▼ 61.99%