83% mobile-redirection-for-pages-and-posts

Code Review | Mobile Redirect For Pages and Posts

WordPress plugin Mobile Redirect For Pages and Posts scored83%from 54 tests.

About plugin

  • Plugin page: mobile-redirectio...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.7.3
  • WordPress version: 6.3.1
  • First release: Apr 24, 2017
  • Latest release: Apr 24, 2017
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: amitgoenka2k (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /1,152 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼7.52ms] Passed 4 tests

A check of server-side resources used by Mobile Redirect For Pages and Posts
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0137.55 ▼10.78
Dashboard /wp-admin3.33 ▲0.0255.56 ▲5.77
Posts /wp-admin/edit.php3.38 ▲0.0248.26 ▼6.71
Add New Post /wp-admin/post-new.php5.91 ▲0.0285.04 ▼16.13
Media Library /wp-admin/upload.php3.25 ▲0.0237.58 ▲3.56

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Mobile Redirect For Pages and Posts
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.37 ▼0.182.13 ▲0.2043.84 ▼2.93
Dashboard /wp-admin2,195 ▲185.59 ▼0.1287.14 ▼12.3237.66 ▼4.90
Posts /wp-admin/edit.php2,100 ▼02.03 ▲0.0238.61 ▲1.1635.27 ▼2.63
Add New Post /wp-admin/post-new.php6,242 ▲4,71318.74 ▼4.25945.78 ▲246.1461.55 ▲2.99
Media Library /wp-admin/upload.php1,400 ▲34.16 ▲0.0696.72 ▼19.7546.09 ▼4.23

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • 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
The smoke test was a success, however most plugin functionality was not tested

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
Please take a closer look at the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mobile-redirection-for-pages-and-posts/mobile_redirect.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that require attention: The official readme.txt is a good inspiration

mobile-redirection-for-pages-and-posts/mobile_redirect.php 85% from 13 tests

The main PHP file in "Mobile Redirect For Pages and Posts" ver. 1.0.0 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Description: Please don't use more than 140 characters for the plugin description (currently 173 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("mobile-redirection-for-pages-and-posts.php" instead of "mobile_redirect.php")

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
No dangerous file extensions were detected97 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1254397

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity9.00
▷ Minimum class complexity9.00
▷ Maximum class complexity9.00
Average method complexity3.00
▷ Minimum method complexity1.00
▷ Maximum method complexity8.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%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
PNG images were not found in this plugin