84% rocket-wp-mobile

Code Review | Mobile Plugin

WordPress plugin Mobile Plugin scored84%from 54 tests.

About plugin

  • Plugin page: rocket-wp-mobile
  • Plugin version: 0.4.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-4.5
  • WordPress version: 6.3.1
  • First release: Aug 2, 2013
  • Latest release: Jun 7, 2016
  • Number of updates: 14
  • Update frequency: every 74.3 days
  • Top authors: Muneeb (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

600+ active /45,605 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
Installer ran successfully

Server metrics [RAM: ▲0.21MB] [CPU: ▼2.01ms] Passed 4 tests

Server-side resources used by Mobile Plugin
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.71 ▲0.2548.83 ▲4.09
Dashboard /wp-admin3.55 ▲0.2450.40 ▼0.93
Posts /wp-admin/edit.php3.60 ▲0.2451.68 ▼1.19
Add New Post /wp-admin/post-new.php6.07 ▲0.1898.36 ▼2.97
Media Library /wp-admin/upload.php3.41 ▲0.1837.05 ▼2.95
WP Mobile /wp-admin/options-general.php?page=wp-mobile-settings3.4136.40

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 131 new files
Database: no new tables, 9 new options
New WordPress options
widget_recent-posts
wpmp_settings
widget_theysaidso_widget
can_compress_scripts
db_upgraded
widget_recent-comments
theysaidso_admin_options
wpmp_theme_settings
wp-mobile-activation-notice

Browser metrics Passed 4 tests

Checking browser requirements for Mobile Plugin
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,840 ▲9413.30 ▼1.051.69 ▼0.2436.31 ▼5.32
Dashboard /wp-admin2,222 ▲404.82 ▼1.06111.73 ▲5.6741.34 ▼4.40
Posts /wp-admin/edit.php2,111 ▲222.00 ▲0.0143.34 ▼0.0844.07 ▲5.41
Add New Post /wp-admin/post-new.php1,389 ▼14417.22 ▼6.03577.97 ▼60.9139.71 ▼9.45
Media Library /wp-admin/upload.php1,404 ▲134.16 ▼0.0699.07 ▼2.4340.19 ▼8.04
WP Mobile /wp-admin/options-general.php?page=wp-mobile-settings1,0281.9028.7251.49

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin does not fully uninstall, leaving 9 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • wp-mobile-activation-notice
    • wpmp_theme_settings
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • wpmp_settings

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however 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 fix the following
  • 37× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wpex_hook_content_before() in wp-content/plugins/rocket-wp-mobile/views/thoughts/content-page.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/rocket-wp-mobile/views/thoughts/404.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/rocket-wp-mobile/views/thoughts/index.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/rocket-wp-mobile/wp-mobile.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/rocket-wp-mobile/views/thoughts/image.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/rocket-wp-mobile/config.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/rocket-wp-mobile/views/thoughts/functions/scripts.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_template_directory_uri() in wp-content/plugins/rocket-wp-mobile/views/thoughts/functions.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wpex_hook_content_before() in wp-content/plugins/rocket-wp-mobile/views/thoughts/content-gallery.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/rocket-wp-mobile/views/thoughts/single.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Tags: Please reduce the number of tags, currently 15 tag instead of maximum 10
The official readme.txt might help

rocket-wp-mobile/wp-mobile.php 92% from 13 tests

Analyzing the main PHP file in "Mobile Plugin" version 0.4.2
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("rocket-wp-mobile.php" instead of "wp-mobile.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin7,087 lines of code in 67 files:
LanguageFilesBlank linesComment linesLines of code
PHP471,2281,6053,291
CSS73151592,250
JavaScript111672221,059
SVG100255
PO File196114232

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity46.00
▷ Minimum class complexity2.00
▷ Maximum class complexity108.00
Average method complexity4.08
▷ Minimum method complexity1.00
▷ Maximum method complexity58.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods117
▷ Static methods10.85%
▷ Public methods10791.45%
▷ Protected methods65.13%
▷ Private methods43.42%
Functions56
▷ Named functions56100.00%
▷ Anonymous functions00.00%
Constants18
▷ Global constants1794.44%
▷ Class constants15.56%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
39 PNG files occupy 0.08MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
views/thoughts/images/prettyPhoto/dark_square/btnPrevious.png1.41KB1.19KB▼ 15.74%
views/thoughts/images/prettyPhoto/default/sprite_y.png1.13KB0.13KB▼ 88.81%
views/thoughts/images/audioplayer/mute-on.png3.03KB0.50KB▼ 83.57%
views/thoughts/images/prettyPhoto/dark_square/contentPattern.png0.12KB0.09KB▼ 20.66%
views/thoughts/images/prettyPhoto/light_square/sprite.png3.42KB2.13KB▼ 37.67%