78% addfunc-mobile-detect

Code Review | AddFunc Mobile Detect

WordPress plugin AddFunc Mobile Detect scored78%from 54 tests.

About plugin

  • Plugin page: addfunc-mobile-de...
  • Plugin version: 3.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.8
  • WordPress version: 6.3.1
  • First release: Dec 10, 2014
  • Latest release: Jul 11, 2016
  • Number of updates: 29
  • Update frequency: every 50.1 days
  • Top authors: joerhoney (82.76%)AddFunc (20.69%)

Code review

54 tests

User reviews

4 reviews

Install metrics

100+ active /12,259 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

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

A check of server-side resources used by AddFunc Mobile Detect
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0640.65 ▼4.44
Dashboard /wp-admin3.38 ▲0.0347.20 ▼16.96
Posts /wp-admin/edit.php3.49 ▲0.1450.73 ▲1.03
Add New Post /wp-admin/post-new.php5.96 ▲0.0889.10 ▼15.18
Media Library /wp-admin/upload.php3.30 ▲0.0734.51 ▼2.68
Mobile Detect /wp-admin/options-general.php?page=aFmobdtct_options3.2929.99

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 5 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
widget_mobsitelink
widget_recent-posts
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for AddFunc Mobile Detect
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲5714.75 ▲0.402.01 ▲0.1344.98 ▲0.89
Dashboard /wp-admin2,193 ▲195.67 ▲0.0788.18 ▼13.6840.37 ▼4.42
Posts /wp-admin/edit.php2,104 ▲42.02 ▼0.0338.09 ▼0.4634.80 ▼0.25
Add New Post /wp-admin/post-new.php6,264 ▲4,71918.75 ▼4.39868.69 ▲181.3365.22 ▲1.57
Media Library /wp-admin/upload.php1,398 ▼54.20 ▼0.0396.98 ▼9.6042.41 ▼8.61
Mobile Detect /wp-admin/options-general.php?page=aFmobdtct_options1,1212.1523.8828.61

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 7 options in the database
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_mobsitelink
    • theysaidso_admin_options
    • widget_recent-posts

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
Please fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=aFmobdtct_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=aFmobdtct_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
Please fix the following items
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/addfunc-mobile-detect/addfunc-mobile-detect.php:24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function screen_icon() in wp-content/plugins/addfunc-mobile-detect/options.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% 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
These attributes need your attention:
  • Tags: Too many tags (24 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

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

Analyzing the main PHP file in "AddFunc Mobile Detect" version 3.1
The following require your attention:
  • Description: Please keep the plugin description shorter than 140 characters (currently 977 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin1,063 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP41756751,063

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.77
Average class complexity48.00
▷ Minimum class complexity2.00
▷ Maximum class complexity134.00
Average method complexity4.28
▷ Minimum method complexity1.00
▷ Maximum method complexity77.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods43
▷ Static methods1330.23%
▷ Public methods4195.35%
▷ Protected methods24.65%
▷ Private methods00.00%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants11
▷ Global constants218.18%
▷ Class constants981.82%
▷ 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
No PNG images were found in this plugin