84% device-mockups

Code Review | Device Mockups

WordPress plugin Device Mockups scored84%from 54 tests.

About plugin

  • Plugin page: device-mockups
  • Plugin version: 1.8.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7-4.8.1
  • WordPress version: 6.3.1
  • First release: May 16, 2014
  • Latest release: Sep 18, 2017
  • Number of updates: 63
  • Update frequency: every 19.4 days
  • Top authors: mrdink (96.83%)phikai (4.76%)

Code review

54 tests

User reviews

8 reviews

Install metrics

1,000+ active /53,123 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼7.11ms] Passed 4 tests

Server-side resources used by Device Mockups
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0542.61 ▼1.69
Dashboard /wp-admin3.35 ▲0.0446.02 ▼4.37
Posts /wp-admin/edit.php3.40 ▲0.0444.79 ▼6.71
Add New Post /wp-admin/post-new.php5.93 ▲0.0483.68 ▼15.67
Media Library /wp-admin/upload.php3.27 ▲0.0435.91 ▲3.94

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 57 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
db_upgraded
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Device Mockups
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,802 ▲5614.73 ▲0.421.76 ▼0.0544.42 ▲4.80
Dashboard /wp-admin2,208 ▲175.86 ▲1.0099.60 ▼2.6839.96 ▼1.69
Posts /wp-admin/edit.php2,091 ▲52.00 ▼0.0136.51 ▼3.3832.94 ▼2.30
Add New Post /wp-admin/post-new.php1,530 ▼1223.05 ▲4.92595.40 ▼98.8553.02 ▼0.76
Media Library /wp-admin/upload.php1,390 ▼14.16 ▼0.0293.78 ▼2.1541.70 ▼1.18

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options

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
Good news, no errors were detected

SRP 50% 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
Almost there! Just fix the following items
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/device-mockups/admin/device-mockups.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/device-mockups/includes/browser.php:58
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/device-mockups/includes/device.php:85

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
7 plugin tags: shortcode, portfolio, device, mockup, iphone...

device-mockups/device-mockups.php 92% from 13 tests

"Device Mockups" version 1.8.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Text Domain: The text domain name should consist of only dashes and lowercase characters

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected3,165 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript2850562,277
CSS216039671
PHP549103204
SVG11013

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.28
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%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.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
40 compressed PNG files occupy 2.13MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/lumia920_land.png18.57KB20.50KB0.00%
images/iphone5s_port_gold.png32.90KB34.95KB0.00%
images/macbook.png28.87KB32.06KB0.00%
images/iphone6_land_silver.png58.59KB61.20KB0.00%
images/ipad_land_black.png9.24KB10.87KB0.00%