84% mobile-preview

Code Review | Mobile Preview

WordPress plugin Mobile Preview scored84%from 54 tests.

About plugin

  • Plugin page: mobile-preview
  • Plugin version: 0.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7-4.0
  • WordPress version: 6.3.1
  • First release: Oct 1, 2014
  • Latest release: Oct 3, 2014
  • Number of updates: 5
  • Update frequency: every 0.4 days
  • Top authors: jarednova (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /1,795 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.08MB] [CPU: ▼5.17ms] Passed 4 tests

An overview of server-side resources used by Mobile Preview
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0941.15 ▼6.69
Dashboard /wp-admin3.38 ▲0.0847.44 ▼9.85
Posts /wp-admin/edit.php3.50 ▲0.1451.60 ▲1.21
Add New Post /wp-admin/post-new.php5.99 ▲0.1089.89 ▼5.34
Media Library /wp-admin/upload.php3.28 ▲0.0539.28 ▲5.58

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 11 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Mobile Preview
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,950 ▲1,18914.64 ▲0.277.29 ▲5.3143.14 ▼2.02
Dashboard /wp-admin2,879 ▲6995.46 ▼0.1995.97 ▲8.2745.12 ▲0.90
Posts /wp-admin/edit.php2,794 ▲6942.94 ▲0.8846.67 ▲5.4040.66 ▲0.34
Add New Post /wp-admin/post-new.php1,955 ▲41518.19 ▼0.15689.20 ▲66.8834.22 ▼28.49
Media Library /wp-admin/upload.php1,841 ▲4474.96 ▲0.79105.79 ▲2.0346.11 ▲3.02

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

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

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
Everything seems fine, however this is by no means an exhaustive test

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
Almost there! Just fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function sanitize_title() in wp-content/plugins/mobile-preview/vendor/upstatement/jigsaw/jigsaw.php:70

User-side errors Passed 1 test

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

Optimizations

Plugin configuration Passed 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
3 plugin tags: preview, mobile, editing

mobile-preview/mobile-preview.php Passed 13 tests

The main PHP script in "Mobile Preview" version 0.0.2 is automatically included on every request by WordPress
48 characters long description:
Preview your site in a variety of mobile devices

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
Everything looks great! No dangerous files found in this plugin586 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP24432395
Markdown231087
CSS14038
Sass14038
JavaScript13014
Ruby1499
Twig1005

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity24.00
▷ Minimum class complexity8.00
▷ Maximum class complexity37.00
Average method complexity2.88
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods29
▷ Static methods2379.31%
▷ Public methods29100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions16
▷ Named functions00.00%
▷ Anonymous functions16100.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
1 PNG file occupies 0.23MB with 0.10MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/devices/iphone-5.png235.40KB128.77KB▼ 45.30%