93% mobile-preview-drawer

Code Review | Mobile Preview Drawer

WordPress plugin Mobile Preview Drawer scored 93% from 54 tests.

About plugin

  • Plugin page: mobile-preview-dr...
  • Plugin version: 0.1.4
  • PHP compatiblity: 5.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-5.2
  • WordPress version: 5.8.1
  • First release: Jul 8, 2018
  • Latest release: Jun 5, 2019
  • Number of updates: 7
  • Update frequency: every 47.4 days
  • Top authors: nettantra (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active / 699 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.01MB] [CPU: ▼138.90ms] Passed 4 tests

An overview of server-side resources used by Mobile Preview Drawer
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.85 ▲0.1334.46 ▲8.43
Dashboard /wp-admin3.07 ▲0.0241.15 ▲3.88
Posts /wp-admin/edit.php3.12 ▲0.0243.25 ▲1.36
Add New Post /wp-admin/post-new.php5.43 ▼0.0088.65 ▼561.73
Media Library /wp-admin/upload.php3.02 ▲0.0133.12 ▲0.90

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 4 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Mobile Preview Drawer
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,815 ▲21916.22 ▲0.6312.22 ▲3.1047.76 ▼5.54
Dashboard /wp-admin2,990 ▲595.94 ▲0.00138.05 ▼14.99114.17 ▼14.71
Posts /wp-admin/edit.php2,756 ▲172.70 ▼0.0065.30 ▲1.2991.70 ▲1.70
Add New Post /wp-admin/post-new.php2,066 ▲39419.74 ▲0.98360.64 ▼5.34100.16 ▼12.77
Media Library /wp-admin/upload.php1,824 ▲175.07 ▲0.05157.86 ▲6.18122.73 ▲2.88

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

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
Please fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mobile-preview-drawer/mobile_preview_drawer.php:21

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 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
4 plugin tags: mobile viewer, mobile drawer, mobile, mobile preview

mobile-preview-drawer/mobile_preview_drawer.php 77% from 13 tests

The primary PHP file in "Mobile Preview Drawer" version 0.1.4 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 307 characters long)
  • Text Domain: The text domain should only use lowercase characters and dashes
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("mobile-preview-drawer.php" instead of "mobile_preview_drawer.php")

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
There were no executable files found in this plugin139 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript274101
PHP141238

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.38
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%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG files were detected