79% page-switcher

Code Review | Page Switcher

WordPress plugin Page Switcher scored 79% from 54 tests.

About plugin

  • Plugin page: page-switcher
  • Plugin version: 1.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-5.2.0
  • WordPress version: 6.3.1
  • First release: Jun 15, 2015
  • Latest release: Jun 12, 2019
  • Number of updates: 20
  • Update frequency: every 73.1 days
  • Top authors: michelve (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

30+ active / 2,261 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

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

A check of server-side resources used by Page Switcher
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0340.56 ▼2.39
Dashboard /wp-admin3.33 ▲0.0345.26 ▼11.97
Posts /wp-admin/edit.php3.39 ▲0.0349.47 ▼1.24
Add New Post /wp-admin/post-new.php5.94 ▲0.0685.87 ▼14.00
Media Library /wp-admin/upload.php3.25 ▲0.0236.47 ▼0.75

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 10 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Page Switcher
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,934 ▲19913.48 ▼1.161.60 ▼0.8439.42 ▼10.84
Dashboard /wp-admin2,325 ▲1375.33 ▼0.57114.78 ▲10.2178.05 ▲31.69
Posts /wp-admin/edit.php2,182 ▲962.66 ▲0.6544.41 ▲7.6937.79 ▲6.28
Add New Post /wp-admin/post-new.php6,532 ▲4,99923.54 ▲0.421,024.73 ▲369.0172.26 ▲18.71
Media Library /wp-admin/upload.php1,401 ▲104.49 ▲0.3295.56 ▼0.3474.41 ▲31.94

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
The following issues need your attention
  • 3× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/page-switcher/admin/get_pages.php
    • > /wp-content/plugins/page-switcher/admin/widgets.php
    • > /wp-content/plugins/page-switcher/admin/get_post.php
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/page-switcher/page-switcher.php:23

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration Passed 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
6 plugin tags: page switcher, smart search, post switcher, switch, switch pages...

page-switcher/page-switcher.php Passed 13 tests

Analyzing the main PHP file in "Page Switcher" version 1.0.4
87 characters long description:
Easily change or switch the current page to other pages from the wordpress page editor.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin277 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP43742153
CSS22999
Markdown18023
JavaScript1002

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.17
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%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
1 PNG file occupies 0.02MB with 0.02MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/img/mamp-logo.png24.72KB3.80KB▼ 84.61%