89% ismobile

Code Review | isMobile() Shortcode for WordPress

WordPress plugin isMobile() Shortcode for WordPress scored89%from 54 tests.

About plugin

  • Plugin page: ismobile
  • Plugin version: 1.1.1
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-6.3
  • WordPress version: 6.3.1
  • First release: Nov 5, 2018
  • Latest release: Sep 17, 2023
  • Number of updates: 68
  • Update frequency: every 26.2 days
  • Top authors: jairo.ochoa (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /1,667 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.19MB] [CPU: ▼7.95ms] Passed 4 tests

An overview of server-side resources used by isMobile() Shortcode for WordPress
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.65 ▲0.1943.49 ▼9.06
Dashboard /wp-admin3.50 ▲0.1952.56 ▲0.04
Posts /wp-admin/edit.php3.61 ▲0.2550.18 ▲2.16
Add New Post /wp-admin/post-new.php6.08 ▲0.1985.55 ▼21.72
Media Library /wp-admin/upload.php3.42 ▲0.1936.67 ▼1.04
isMobile() /wp-admin/plugins.php?page=ismobile_help3.3835.58

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 15 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

isMobile() Shortcode for WordPress: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲3313.24 ▼1.061.93 ▼0.1542.95 ▼6.71
Dashboard /wp-admin2,210 ▲225.89 ▲1.00107.83 ▼7.7839.45 ▼6.45
Posts /wp-admin/edit.php2,090 ▲12.04 ▼0.0238.63 ▲2.5034.88 ▼4.55
Add New Post /wp-admin/post-new.php1,541 ▲723.30 ▲0.28670.92 ▼26.0652.22 ▼13.58
Media Library /wp-admin/upload.php1,395 ▲74.19 ▼0.0893.51 ▼17.5045.85 ▼2.99
isMobile() /wp-admin/plugins.php?page=ismobile_help1,0312.0132.7254.11

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-comments
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts

Smoke tests Passed 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 Passed 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
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
8 plugin tags: iphone, desktop, ios, android, tablet...

ismobile/ismobile-shortcode.php 85% from 13 tests

"isMobile() Shortcode for WordPress" version 1.1.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("ismobile.php" instead of "ismobile-shortcode.php")
  • Description: Please don't use more than 140 characters for the plugin description (currently 244 characters long)

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
There were no executable files found in this plugin1,118 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP3243872854
PO File27680255
CSS1709

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.83
Average class complexity141.00
▷ Minimum class complexity141.00
▷ Maximum class complexity141.00
Average method complexity4.89
▷ Minimum method complexity1.00
▷ Maximum method complexity78.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods36
▷ Static methods925.00%
▷ Public methods3391.67%
▷ Protected methods25.56%
▷ Private methods12.78%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants00.00%
▷ Class constants9100.00%
▷ Public constants9100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
img/mobiledetect-logo.png13.38KB5.94KB▼ 55.61%