78% addfunc-mobile-detect

Code Review | AddFunc Mobile Detect

WordPress plugin AddFunc Mobile Detect scored 78% 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: 5.9.2
  • 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 / 11,841 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
Installer ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼304.27ms] Passed 4 tests

An overview of server-side resources used by AddFunc Mobile Detect
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1059.71 ▲10.53
Dashboard /wp-admin3.49 ▲0.0833.15 ▼0.93
Posts /wp-admin/edit.php3.72 ▲0.0837.02 ▼4.56
Add New Post /wp-admin/post-new.php6.96 ▼0.0294.75 ▼1,212.94
Media Library /wp-admin/upload.php3.37 ▲0.0727.10 ▲1.36
Mobile Detect /wp-admin/options-general.php?page=aFmobdtct_options3.3622.83

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 5 new files
Database: no new tables, 1 new option
New WordPress options
widget_mobsitelink

Browser metrics Passed 4 tests

AddFunc Mobile Detect: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,800 ▲5615.94 ▲0.266.08 ▼0.242.92 ▲0.36
Dashboard /wp-admin2,893 ▲326.10 ▲0.05118.02 ▼18.71152.29 ▼11.87
Posts /wp-admin/edit.php2,696 ▲83.24 ▲0.0064.42 ▼0.22140.90 ▲0.14
Add New Post /wp-admin/post-new.php1,740 ▼1221.86 ▲0.36466.38 ▲17.15168.56 ▲8.15
Media Library /wp-admin/upload.php1,703 ▲55.53 ▲0.05152.00 ▲5.69183.55 ▼5.28
Mobile Detect /wp-admin/options-general.php?page=aFmobdtct_options1,4722.3753.42100.85

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • The uninstall procedure has failed, leaving 1 option in the database
    • widget_mobsitelink

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=aFmobdtct_options
    • > User deprecated in wp-includes/functions.php+5326
    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+5326
    get_screen_icon is deprecated since version 3.8.0 with no alternative available.

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
The following issues need your attention
  • 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: Please reduce the number of tags, currently 24 tag instead of maximum 10
The official readme.txt is a good inspiration

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

The main PHP file in "AddFunc Mobile Detect" ver. 3.1 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • 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 | Executable files are considered dangerous and should not be included with any WordPress 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

This is a short overview of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
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
PNG images were not found in this plugin