84% responsive-page-tester

Code Review | Responsive Page Tester

WordPress plugin Responsive Page Tester scored84%from 54 tests.

About plugin

  • Plugin page: responsive-page-t...
  • Plugin version: 3.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-4.4
  • WordPress version: 6.3.1
  • First release: Mar 5, 2013
  • Latest release: Mar 28, 2016
  • Number of updates: 10
  • Update frequency: every 111.9 days
  • Top authors: desrosj (100%)

Code review

54 tests

User reviews

10 reviews

Install metrics

40+ active /13,431 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼2.75ms] Passed 4 tests

Server-side resources used by Responsive Page Tester
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0038.30 ▼6.53
Dashboard /wp-admin3.31 ▲0.0050.37 ▼6.03
Posts /wp-admin/edit.php3.36 ▲0.0049.89 ▲2.84
Add New Post /wp-admin/post-new.php5.89 ▲0.0097.54 ▲0.49
Media Library /wp-admin/upload.php3.23 ▲0.0039.50 ▲1.09

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

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

Browser metrics Passed 4 tests

Responsive Page Tester: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.26 ▼1.111.73 ▼0.3641.91 ▼1.17
Dashboard /wp-admin2,209 ▲214.86 ▼0.99102.05 ▼20.7339.17 ▼4.90
Posts /wp-admin/edit.php2,089 ▲32.06 ▲0.0241.20 ▲4.0737.03 ▲2.17
Add New Post /wp-admin/post-new.php1,514 ▼1917.78 ▼5.47648.95 ▼32.4261.97 ▲5.06
Media Library /wp-admin/upload.php1,388 ▼04.24 ▲0.10110.52 ▼6.3945.18 ▼4.80

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 75% 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 50% 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
Almost there! Just fix the following items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/responsive-page-tester/responsive-page-tester.php:39

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
6 plugin tags: responsive, test, mobile, design, layout...

responsive-page-tester/responsive-page-tester.php Passed 13 tests

The main PHP script in "Responsive Page Tester" version 3.0 is automatically included on every request by WordPress
75 characters long description:
Gives editors the ability to preview their content in a responsive testbed.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected1,034 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
CSS15060547
JavaScript1168147375
PHP13193112

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.59
Average class complexity20.00
▷ Minimum class complexity20.00
▷ Maximum class complexity20.00
Average method complexity2.58
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods12
▷ Static methods00.00%
▷ Public methods1191.67%
▷ Protected methods00.00%
▷ Private methods18.33%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
2 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/linchpin.png7.85KB5.73KB▼ 26.97%
images/ui-icons_ffffff_256x240.png6.15KB4.17KB▼ 32.13%