78% average-mobile-detect

Code Review | Average Mobile Detect

WordPress plugin Average Mobile Detect scored78%from 54 tests.

About plugin

  • Plugin page: average-mobile-de...
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.1
  • WordPress version: 6.3.1
  • First release: Aug 29, 2014
  • Latest release: Jan 15, 2015
  • Number of updates: 28
  • Update frequency: every 5.0 days
  • Top authors: average.technology (89.29%)AddFunc (14.29%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /5,232 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.06MB] [CPU: ▼3.16ms] Passed 4 tests

An overview of server-side resources used by Average Mobile Detect
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0542.23 ▼2.03
Dashboard /wp-admin3.37 ▲0.0651.41 ▼1.20
Posts /wp-admin/edit.php3.48 ▲0.1249.46 ▼1.06
Add New Post /wp-admin/post-new.php5.95 ▲0.0696.61 ▼8.01
Media Library /wp-admin/upload.php3.29 ▲0.0637.47 ▼1.41
Mobile Detect /wp-admin/options-general.php?page=avrgmobdtct_options3.2632.90

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 5 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
db_upgraded
widget_recent-comments
theysaidso_admin_options
widget_mobsitelink

Browser metrics Passed 4 tests

An overview of browser requirements for Average Mobile Detect
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲5813.31 ▼0.944.63 ▲2.6338.84 ▼9.38
Dashboard /wp-admin2,216 ▲104.87 ▼0.03106.87 ▲1.2640.84 ▼4.16
Posts /wp-admin/edit.php2,107 ▲72.04 ▲0.0041.02 ▼1.3835.84 ▼0.11
Add New Post /wp-admin/post-new.php6,255 ▲4,70926.20 ▲2.65873.94 ▲255.5263.12 ▼0.30
Media Library /wp-admin/upload.php1,401 ▼24.28 ▲0.0198.43 ▼5.4841.18 ▼8.82
Mobile Detect /wp-admin/options-general.php?page=avrgmobdtct_options9932.0625.6436.75

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
The following items require your attention
  • Zombie WordPress options were found after uninstall: 7 options
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_mobsitelink

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=avrgmobdtct_options
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=avrgmobdtct_options
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.

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
Almost there! Just fix the following items
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/average-mobile-detect/average-mobile-detect.php:26
    • > PHP Fatal error
      Uncaught Error: Call to undefined function screen_icon() in wp-content/plugins/average-mobile-detect/options.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed:
  • Tags: Please delete some tags, you are using 11 tag instead of maximum 10
The official readme.txt might help

average-mobile-detect/average-mobile-detect.php 92% from 13 tests

Analyzing the main PHP file in "Average Mobile Detect" version 1.2
The following require your attention:
  • Description: Keep the plugin description shorter than 140 characters (currently 948 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin966 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP4166582966

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.73
Average class complexity41.00
▷ Minimum class complexity2.00
▷ Maximum class complexity113.00
Average method complexity4.08
▷ Minimum method complexity1.00
▷ Maximum method complexity69.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods39
▷ Static methods1333.33%
▷ Public methods3794.87%
▷ Protected methods25.13%
▷ Private methods00.00%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants11
▷ Global constants218.18%
▷ Class constants981.82%
▷ Public constants9100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
PNG images were not found in this plugin