84% mobile-featured-image

Code Review | Mobile Featured Image

WordPress plugin Mobile Featured Image scored84%from 54 tests.

About plugin

  • Plugin page: mobile-featured-i...
  • Plugin version: 0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-4.7.2
  • WordPress version: 6.3.1
  • First release: Feb 4, 2017
  • Latest release: Feb 5, 2017
  • Number of updates: 8
  • Update frequency: every 1.4 days
  • Top authors: ryanshoover (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

80+ active /2,659 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.31MB] [CPU: ▼11.13ms] Passed 4 tests

An overview of server-side resources used by Mobile Featured Image
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0138.86 ▼4.39
Dashboard /wp-admin3.80 ▲0.4653.88 ▼10.68
Posts /wp-admin/edit.php3.82 ▲0.4651.06 ▲0.05
Add New Post /wp-admin/post-new.php6.18 ▲0.2982.54 ▼29.51
Media Library /wp-admin/upload.php3.72 ▲0.4939.32 ▲5.46

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Mobile Featured Image
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,826 ▲6513.71 ▼0.614.34 ▲2.4039.91 ▼5.23
Dashboard /wp-admin2,229 ▲225.86 ▲0.94102.85 ▼20.0240.26 ▼8.31
Posts /wp-admin/edit.php2,114 ▲142.10 ▲0.0540.94 ▲0.7936.89 ▲2.56
Add New Post /wp-admin/post-new.php679 ▼8471.73 ▼15.8123.17 ▼635.017.12 ▼37.37
Media Library /wp-admin/upload.php1,411 ▲144.27 ▲0.01104.24 ▼0.5146.84 ▼0.72

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 7 options
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • recovery_mode_email_last_sent

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 53× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Multi_Base' not found in wp-content/plugins/mobile-featured-image/lib/cmb2/includes/types/CMB2_Type_Taxonomy_Base.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Base' not found in wp-content/plugins/mobile-featured-image/lib/cmb2/includes/types/CMB2_Type_Taxonomy_Select.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_REST_Controller' not found in wp-content/plugins/mobile-featured-image/lib/cmb2/includes/rest-api/CMB2_REST_Controller_Boxes.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Base' not found in wp-content/plugins/mobile-featured-image/lib/cmb2/includes/types/CMB2_Type_Text.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/mobile-featured-image/lib/cmb2/tests/cmb-tests-base.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/mobile-featured-image/lib/cmb2/tests/cmb-tests-base.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/mobile-featured-image/lib/cmb2/tests/cmb-tests-base.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Base' not found in wp-content/plugins/mobile-featured-image/lib/cmb2/includes/types/CMB2_Type_Textarea.php:13
    • > PHP Notice
      Undefined index: test_root in wp-content/plugins/mobile-featured-image/lib/cmb2/tests/bootstrap.php on line 24
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text' not found in wp-content/plugins/mobile-featured-image/lib/cmb2/includes/types/CMB2_Type_Checkbox.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
5 plugin tags: featured image, responsive, mobile, srcset, thumbnail

mobile-featured-image/mobile-featured-image.php 92% from 13 tests

The entry point to "Mobile Featured Image" version 0.1 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

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
Good job! No executable or dangerous file extensions detected96,682 lines of code in 228 files:
LanguageFilesBlank linesComment linesLines of code
XML20047,741
PO File12013,78217,88231,544
PHP662,6845,2279,461
CSS121,1021,1364,756
Sass14265251,258
JavaScript52562951,086
Markdown52220621
JSON300122
Bourne Shell1231193

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity14.96
▷ Minimum class complexity1.00
▷ Maximum class complexity149.00
Average method complexity2.54
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes82
▷ Abstract classes1113.41%
▷ Concrete classes7186.59%
▷ Final classes00.00%
Methods745
▷ Static methods9512.75%
▷ Public methods63485.10%
▷ Protected methods10313.83%
▷ Private methods81.07%
Functions33
▷ Named functions33100.00%
▷ Anonymous functions00.00%
Constants14
▷ Global constants857.14%
▷ Class constants642.86%
▷ Public constants6100.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
14 compressed PNG files occupy 0.02MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
lib/cmb2/images/ui-bg_flat_75_ffffff_40x100.png0.17KB0.08KB▼ 51.12%
lib/cmb2/images/ui-bg_glass_75_dadada_1x400.png0.11KB0.16KB0.00%
lib/cmb2/images/ui-bg_glass_95_fef1ec_1x400.png0.12KB0.14KB0.00%
lib/cmb2/images/ui-bg_glass_65_ffffff_1x400.png0.10KB0.10KB▼ 5.71%
lib/cmb2/images/ico-delete.png0.70KB0.72KB0.00%