84% smart-mockups

Code Review | Smart Mockups

WordPress plugin Smart Mockups scored84%from 54 tests.

About plugin

  • Plugin page: smart-mockups
  • Plugin version: 1.2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.5.3
  • WordPress version: 6.3.1
  • First release: Feb 8, 2016
  • Latest release: Jun 23, 2016
  • Number of updates: 24
  • Update frequency: every 5.7 days
  • Top authors: stefanomarra (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

30+ active /6,705 total downloads


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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.39MB] [CPU: ▲1.45ms] Passed 4 tests

Analyzing server-side resources used by Smart Mockups
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.88 ▲0.4248.14 ▲9.32
Dashboard /wp-admin3.75 ▲0.4056.62 ▲0.96
Posts /wp-admin/edit.php3.79 ▲0.4358.13 ▲9.28
Add New Post /wp-admin/post-new.php6.27 ▲0.3891.69 ▼13.78
Media Library /wp-admin/upload.php3.59 ▲0.3544.34 ▲10.97
Add New /wp-admin/post-new.php?post_type=smart_mockup3.7752.02
All Mockups /wp-admin/edit.php?post_type=smart_mockup3.7046.76
Settings /wp-admin/edit.php?post_type=smart_mockup&page=smartmockups_settings3.5841.19

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 44 new files
Database: no new tables, 6 new options
New WordPress options

Browser metrics Passed 4 tests

Smart Mockups: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,996 ▲25014.87 ▲0.411.90 ▼0.0245.00 ▼1.98
Dashboard /wp-admin2,399 ▲2076.70 ▲1.73130.47 ▲16.2638.93 ▼5.21
Posts /wp-admin/edit.php2,305 ▲2163.65 ▲1.6553.97 ▲15.1031.86 ▼1.65
Add New Post /wp-admin/post-new.php1,560 ▲4623.31 ▲5.86624.75 ▼69.7035.52 ▼33.90
Media Library /wp-admin/upload.php1,444 ▲564.25 ▲0.1185.76 ▼11.9345.43 ▲3.88
Add New /wp-admin/post-new.php?post_type=smart_mockup2,4797.87188.4571.50
All Mockups /wp-admin/edit.php?post_type=smart_mockup1,2773.5246.3027.48
Settings /wp-admin/edit.php?post_type=smart_mockup&page=smartmockups_settings1,0603.3146.5227.69

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded

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
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
The following issues need your attention
  • 4× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_the_ID() in wp-content/plugins/smart-mockups/public/templates/smart-mockups-password-display.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function sm_is_notification_enabled() in wp-content/plugins/smart-mockups/admin/templates/settings-notifications.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_the_ID() in wp-content/plugins/smart-mockups/public/templates/smart-mockups-public-display.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Smart_Mockups_Setup' not found in wp-content/plugins/smart-mockups/admin/templates/settings-general.php:3

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


Plugin configuration 97% from 29 tests

readme.txt 94% 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:
  • Tags: Please delete some tags, you are using 19 tag instead of maximum 10
The official readme.txt might help

smart-mockups/smart-mockups.php Passed 13 tests

The primary PHP file in "Smart Mockups" version 1.2.0 is used by WordPress to initiate all plugin functionality
62 characters long description:
Get instant reviews, comments and feedbacks from your clients.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin4,618 lines of code in 37 files:
LanguageFilesBlank linesComment linesLines of code
PO File15155137

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity12.00
▷ Minimum class complexity1.00
▷ Maximum class complexity34.00
Average method complexity2.23
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes00.00%
▷ Static methods99.18%
▷ Public methods9293.88%
▷ Protected methods00.00%
▷ Private methods66.12%
▷ Named functions21100.00%
▷ Anonymous functions00.00%
▷ Global constants5100.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
There were not PNG files found in your plugin