56% truenorth-srcset

Code Review | SrcSet Responsive Images for Wordpress

WordPress plugin SrcSet Responsive Images for Wordpress scored56%from 54 tests.

About plugin

  • Plugin page: truenorth-srcset
  • Plugin version: 1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.5
  • WordPress version: 6.3.1
  • First release: Jan 14, 2015
  • Latest release: Apr 14, 2016
  • Number of updates: 36
  • Update frequency: every 12.7 days
  • Top authors: ben.moody (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

70+ active /5,663 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▼0.03MB] [CPU: ▼33.08ms] Passed 4 tests

This is a short check of server-side resources used by SrcSet Responsive Images for Wordpress
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1140.12 ▼2.88
Dashboard /wp-admin4.11 ▲0.7724.26 ▼42.52
Posts /wp-admin/edit.php4.12 ▲0.7630.29 ▼14.80
Add New Post /wp-admin/post-new.php4.11 ▼1.7727.43 ▼64.93
Media Library /wp-admin/upload.php4.11 ▲0.8924.63 ▼10.05
SrcSet Settings /wp-admin/tools.php?page=tnsrc_set_options_options4.1224.82

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 426 new files
Database: no new tables, 8 new options
New WordPress options
redux-framework-tracking
theysaidso_admin_options
tnsrc_set_options-transients
widget_theysaidso_widget
can_compress_scripts
db_upgraded
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by SrcSet Responsive Images for Wordpress
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,812 ▲6613.32 ▼0.941.82 ▲0.0740.30 ▼3.31
Dashboard /wp-admin2,215 ▲275.89 ▲1.02107.45 ▼14.6243.06 ▼0.22
Posts /wp-admin/edit.php2,098 ▲92.04 ▲0.0339.95 ▲1.6335.62 ▲2.30
Add New Post /wp-admin/post-new.php1,545 ▲2618.32 ▼5.09618.13 ▼62.0951.60 ▲8.33
Media Library /wp-admin/upload.php1,397 ▲94.24 ▲0.0895.42 ▼0.7842.58 ▼1.16
SrcSet Settings /wp-admin/tools.php?page=tnsrc_set_options_options1,87511.41326.6656.46

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
These items require your attention
  • This plugin did not uninstall without warnings or errors
    • > Warning in wp-content/plugins/truenorth-srcset/inc/ReduxFramework/ReduxCore/extensions/customizer/extension_customizer.php+358
    "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?
  • The uninstall procedure has failed, leaving 8 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • redux-framework-tracking
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • tnsrc_set_options-transients

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Almost there, just fix the following server-side errors
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/tools.php?page=tnsrc_set_options_options
    • > Warning in wp-content/plugins/truenorth-srcset/inc/ReduxFramework/ReduxCore/extensions/customizer/extension_customizer.php+442
    "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?

SRP 0% 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 fix the following
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/truenorth-srcset/inc/ReduxFramework/ReduxCore/inc/p.php
  • 12× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/truenorth-srcset/inc/ReduxFramework/ReduxCore/extensions/customizer/extension_customizer.php on line 411
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/truenorth-srcset/inc/ReduxFramework/ReduxCore/extensions/customizer/extension_customizer.php on line 358
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/truenorth-srcset/inc/ReduxFramework/ReduxCore/extensions/customizer/extension_customizer.php on line 384
    • > PHP Notice
      Undefined variable: header in wp-content/plugins/truenorth-srcset/inc/ReduxFramework/ReduxCore/inc/p.php on line 219
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/truenorth-srcset/inc/ReduxFramework/ReduxCore/extensions/customizer/extension_customizer.php on line 380
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/truenorth-srcset/inc/ReduxFramework/ReduxCore/inc/fields/select/elusive-icons.php:312
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/truenorth-srcset/inc/class.tn-srcset-regen.php:46
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/truenorth-srcset/inc/ReduxFramework/ReduxCore/extensions/customizer/extension_customizer.php on line 423
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/truenorth-srcset/tn-srcset.php:22
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/truenorth-srcset/inc/ReduxFramework/ReduxCore/extensions/customizer/extension_customizer.php on line 442

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please fix the following browser errors
    • > GET request to /wp-admin/tools.php?page=tnsrc_set_options_options
    • > Javascript (severe) in unknown
    /wp-content/plugins/truenorth-srcset/inc/ReduxFramework/ReduxCore/inc/fields/multi_text/field_multi_text.min.js?ver=1696808187 0:495 Uncaught TypeError: b.find(...).live is not a function

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
6 plugin tags: srcset attribute, retina images, responsive, srcset, retina...

truenorth-srcset/tn-srcset.php 85% from 13 tests

This is the main PHP file of "SrcSet Responsive Images for Wordpress" version 1.4, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Text Domain: Please use dashes and lowercase characters for text domains
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("truenorth-srcset.php" instead of "tn-srcset.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
Good job! No executable or dangerous file extensions detected34,537 lines of code in 334 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript1542,7172,17212,637
PHP773,4915,41311,794
LESS313952024,116
CSS402961483,811
Sass24301,070
PO File1223293544
SVG100309
Markdown229070
HTML18060
Bourne Shell124055
JSON10036
YAML10135

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.60
Average class complexity36.49
▷ Minimum class complexity1.00
▷ Maximum class complexity794.00
Average method complexity6.81
▷ Minimum method complexity1.00
▷ Maximum method complexity91.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes72
▷ Abstract classes00.00%
▷ Concrete classes72100.00%
▷ Final classes00.00%
Methods440
▷ Static methods347.73%
▷ Public methods36683.18%
▷ Protected methods429.55%
▷ Private methods327.27%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants787.50%
▷ Class constants112.50%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
39 PNG files occupy 0.27MB with 0.06MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
inc/ReduxFramework/ReduxCore/assets/css/vendor/jquery-ui-bootstrap/images/ui-icons_f6cf3b_256x240.png8.68KB4.11KB▼ 52.68%
inc/ReduxConfig/patterns/triangular_@2X.png0.21KB0.25KB0.00%
inc/ReduxConfig/patterns/tree_bark.png41.37KB43.65KB0.00%
inc/ReduxFramework/ReduxCore/assets/css/vendor/jquery-ui-bootstrap/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.10KB0.17KB0.00%
inc/ReduxFramework/ReduxCore/assets/css/vendor/jquery-ui-bootstrap/images/ui-bg_flat_0_aaaaaa_40x100.png0.18KB0.08KB▼ 51.67%