84% page-swapper

Code Review | PageSwapper

WordPress plugin PageSwapper scored 84% from 54 tests.

About plugin

  • Plugin page: page-swapper
  • Plugin version: 1.2.8
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.0
  • WordPress version: 6.3.1
  • First release: Oct 5, 2015
  • Latest release: Dec 5, 2018
  • Number of updates: 66
  • Update frequency: every 17.6 days
  • Top authors: crazypsycho (90.91%)rtowebsites (10.61%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 3,506 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

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

An overview of server-side resources used by PageSwapper
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0437.30 ▼2.34
Dashboard /wp-admin3.33 ▲0.0245.93 ▼4.91
Posts /wp-admin/edit.php3.38 ▲0.0248.38 ▲0.64
Add New Post /wp-admin/post-new.php5.93 ▲0.0482.70 ▼7.64
Media Library /wp-admin/upload.php3.25 ▲0.0233.99 ▼1.89

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for PageSwapper
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,253 ▲51814.64 ▲0.2525.44 ▲23.7647.36 ▲5.67
Dashboard /wp-admin2,226 ▲384.90 ▼0.98107.96 ▲6.9337.00 ▼8.97
Posts /wp-admin/edit.php2,109 ▲232.02 ▲0.0538.81 ▼2.3635.08 ▼1.93
Add New Post /wp-admin/post-new.php1,538 ▲1923.46 ▲0.25625.81 ▼57.0158.51 ▼9.66
Media Library /wp-admin/upload.php1,405 ▲174.29 ▲0.1099.36 ▲5.0143.99 ▼1.36

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
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/page-swapper/admin/partials/page-swapper-admin-display.php
    • > /wp-content/plugins/page-swapper/public/partials/page-swapper-public-display.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need to be fixed:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === page-swapper === )
The official readme.txt might help

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

"PageSwapper" version 1.2.8's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
27 characters long description:
Swap pages with transitions

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin1,525 lines of code in 40 files:
LanguageFilesBlank linesComment linesLines of code
PHP20225707687
JavaScript8122238471
CSS82250281
PO File113047
JSON30039

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity7.36
▷ Minimum class complexity1.00
▷ Maximum class complexity40.00
Average method complexity2.46
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces4
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes00.00%
Methods50
▷ Static methods510.00%
▷ Public methods4488.00%
▷ Protected methods00.00%
▷ Private methods612.00%
Functions6
▷ Named functions466.67%
▷ Anonymous functions233.33%
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
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
build/css/grabbing.png0.11KB0.14KB0.00%