78% make-it-srcset

Code Review | Make it Srcset

WordPress plugin Make it Srcset scored78%from 54 tests.

About plugin

  • Plugin page: make-it-srcset
  • Plugin version: 2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4.0-4.7.4
  • WordPress version: 6.3.1
  • First release: Apr 8, 2016
  • Latest release: May 10, 2017
  • Number of updates: 3
  • Update frequency: every 132.7 days
  • Top authors: samuelbrynolf (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,379 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

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

A check of server-side resources used by Make it Srcset
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0142.86 ▲2.44
Dashboard /wp-admin3.34 ▲0.0448.59 ▲1.25
Posts /wp-admin/edit.php3.39 ▲0.0443.47 ▼3.49
Add New Post /wp-admin/post-new.php5.92 ▲0.0392.73 ▼6.26
Media Library /wp-admin/upload.php3.26 ▲0.0333.88 ▼2.01
Make it Srcset /wp-admin/plugins.php?page=mis_plugin_options3.2329.02

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 11 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
widget_recent-comments
mis_plugin_options
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Make it Srcset
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲4713.68 ▼0.231.75 ▼0.6642.25 ▼0.81
Dashboard /wp-admin2,213 ▲344.88 ▼0.93112.11 ▲12.4141.73 ▲0.27
Posts /wp-admin/edit.php2,097 ▲111.98 ▼0.0251.23 ▲15.8440.75 ▲6.33
Add New Post /wp-admin/post-new.php1,545 ▲2518.27 ▼4.93602.81 ▼62.9954.07 ▲0.91
Media Library /wp-admin/upload.php1,392 ▲44.22 ▲0.0193.88 ▼11.7342.77 ▼2.39
Make it Srcset /wp-admin/plugins.php?page=mis_plugin_options1,0982.0323.1849.60

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/make-it-srcset/makeitsrcset.php
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/make-it-srcset/mis_includes/mis_functions.php:24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/make-it-srcset/mis_includes/mis_settings.php:16

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 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
1 plugin tags: srcset

make-it-srcset/makeitsrcset.php 92% from 13 tests

This is the main PHP file of "Make it Srcset" version 2.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("make-it-srcset.php" instead of "makeitsrcset.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin735 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP4204202664
JavaScript4131166
Markdown1304
CSS1001

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity3.00
▷ Minimum class complexity3.00
▷ Maximum class complexity3.00
Average method complexity1.50
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions41
▷ Named functions41100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
No PNG files were detected