94% mockups

Code Review | Mockups

WordPress plugin Mockups scored 94% from 54 tests.

About plugin

  • Plugin page: mockups
  • Plugin version: 1.0.2
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.1-5.2
  • WordPress version: 5.8.1
  • First release: Oct 5, 2019
  • Latest release: Oct 5, 2019
  • Number of updates: 4
  • Update frequency: every 0.5 days
  • Top authors: launchui (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 492 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

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

Analyzing server-side resources used by Mockups
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.68 ▼0.1525.13 ▼9.78
Dashboard /wp-admin3.08 ▲0.0349.29 ▲4.29
Posts /wp-admin/edit.php3.13 ▲0.0249.60 ▼2.32
Add New Post /wp-admin/post-new.php5.43 ▼0.0097.16 ▼563.72
Media Library /wp-admin/upload.php3.02 ▲0.0236.31 ▲5.24

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Mockups
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,813 ▲24116.17 ▲0.4214.94 ▲8.3648.31 ▼9.25
Dashboard /wp-admin2,973 ▲396.04 ▼0.09138.82 ▼11.89111.26 ▼7.61
Posts /wp-admin/edit.php2,739 ▲32.70 ▼0.1269.45 ▼1.0694.21 ▲1.28
Add New Post /wp-admin/post-new.php1,694 ▲1117.81 ▼0.82381.14 ▼3.15131.87 ▲14.24
Media Library /wp-admin/upload.php1,807 ▼05.02 ▲0.01145.94 ▼15.77118.25 ▼10.69

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
This plugin's uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

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 take a closer look at the following
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function mockups\\add_action() in wp-content/plugins/mockups/lib/enqueue-scripts.php:38
    • > PHP Fatal error
      Uncaught Error: Call to undefined function mockups\\iphonex\\add_action() in wp-content/plugins/mockups/blocks/iphonex/index.php:5

User-side errors Passed 1 test

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

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
7 plugin tags: iphonex, devices, screenshot, mobile, mockups...

mockups/mockups.php Passed 13 tests

The main PHP script in "Mockups" version 1.0.2 is automatically included on every request by WordPress
58 characters long description:
Beautiful device mockups you can use right from WordPress.

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
No dangerous file extensions were detected763 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript83530490
PHP33742108
Sass36655
JSON10038
CSS39437
Markdown111020
YAML12015

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.22
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
Namespaces2
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%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
4 PNG files occupy 0.91MB with 0.45MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
wp-content/uploads/2019/10/27-original.png824.28KB1,310.04KB0.00%
wp-content/uploads/2019/10/launch-ui-image-139x300.png29.32KB12.29KB▼ 58.10%
wp-content/uploads/2019/10/launch-ui-image-150x150.png9.59KB3.68KB▼ 61.61%
wp-content/uploads/2019/10/launch-ui-image.png73.47KB15.32KB▼ 79.14%