84% switch-pages

Code Review | Switch Pages

WordPress plugin Switch Pages scored84%from 54 tests.

About plugin

  • Plugin page: switch-pages
  • Plugin version: 2.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.8
  • WordPress version: 6.3.1
  • First release: Jul 16, 2018
  • Latest release: Jul 21, 2021
  • Number of updates: 10
  • Update frequency: every 110.2 days
  • Top authors: brijeshk89 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /1,323 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

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

An overview of server-side resources used by Switch Pages
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.76 ▲0.0242.25 ▼1.72
Dashboard /wp-admin3.58 ▲0.0250.73 ▼2.84
Posts /wp-admin/edit.php3.70 ▲0.0254.92 ▲2.69
Add New Post /wp-admin/post-new.php6.11 ▼0.0391.75 ▼9.06
Media Library /wp-admin/upload.php3.51 ▲0.0245.49 ▲7.33

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

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

Browser metrics Passed 4 tests

Switch Pages: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.27 ▼0.101.83 ▲0.0144.31 ▼2.22
Dashboard /wp-admin2,195 ▲155.65 ▼0.0491.95 ▼7.9341.07 ▼5.34
Posts /wp-admin/edit.php2,100 ▼02.06 ▲0.0241.44 ▲3.6235.11 ▲1.01
Add New Post /wp-admin/post-new.php1,691 ▲13722.23 ▼0.86664.35 ▼50.4159.36 ▲8.02
Media Library /wp-admin/upload.php1,403 ▼04.19 ▼0.06115.56 ▲10.6448.18 ▲2.56

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
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/switch-pages/switch-pages.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 ([Gutenberg] Choose the page/post you want to navigate to from the dropdown), #2 ([Classic Editor] Choose the page/post you want to navigate to from the dropdown)
You can take inspiration from this readme.txt

switch-pages/switch-pages.php 92% from 13 tests

The entry point to "Switch Pages" version 2.0 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Description: Please don't use more than 140 characters for the plugin description (currently 290 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin169 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript111585
PHP2414484

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.12MB with 0.06MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png63.26KB30.08KB▼ 52.46%
screenshot-1.png56.96KB28.98KB▼ 49.12%