10% mobile-smart

Code Review | Mobile Smart

WordPress plugin Mobile Smart scored10%from 54 tests.

About plugin

  • Plugin page: mobile-smart
  • Plugin version: v1.3.16...
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-4.8
  • WordPress version: 6.3.1
  • First release: Dec 21, 2009
  • Latest release: Oct 11, 2017
  • Number of updates: 62
  • Update frequency: every 46.1 days
  • Top authors: dolby_uk (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

2,000+ active /176,237 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The following installer errors require your attention
  • Install procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/mobile-smart/mobile-smart-switcher-widget.php+77
    Function create_function() is deprecated

Server metrics [RAM: ▼1.48MB] [CPU: ▼60.35ms] Passed 4 tests

Analyzing server-side resources used by Mobile Smart
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.52 ▼0.946.03 ▼42.03
Dashboard /wp-admin2.54 ▼0.816.71 ▼58.96
Posts /wp-admin/edit.php2.54 ▼0.827.82 ▼43.37
Add New Post /wp-admin/post-new.php2.54 ▼3.357.46 ▼97.04
Media Library /wp-admin/upload.php2.54 ▼0.697.51 ▼27.22

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Mobile Smart
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲4714.74 ▲0.431.60 ▼0.1746.17 ▲2.48
Dashboard /wp-admin2,199 ▲195.57 ▼0.1488.02 ▼5.1343.86 ▲2.94
Posts /wp-admin/edit.php2,104 ▲12.02 ▼0.0337.15 ▼5.8333.51 ▼3.88
Add New Post /wp-admin/post-new.php1,548 ▲823.52 ▲0.37655.15 ▲15.9963.29 ▲6.07
Media Library /wp-admin/upload.php1,398 ▼24.13 ▼0.21101.64 ▼0.6247.75 ▼0.19
Mobile Smart /wp-admin/mobile-smart.php260.440.1415.33

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • Uninstall procedure had uncaught errors
    • > Deprecated in wp-content/plugins/mobile-smart/mobile-smart-switcher-widget.php+77
    Function create_function() is deprecated
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • MobileSmartOptions
    • widget_mobilesmartswitcherwidget
    • db_upgraded
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 3× PHP files output text when accessed directly:
    • > /wp-content/plugins/mobile-smart/mobile-smart-theme/comments.php
    • > /wp-content/plugins/mobile-smart/mobile-smart-theme/tools/googleanalyticsformobile/php/sample.php
    • > /wp-content/plugins/mobile-smart/mobile-smart-theme/tools/googleanalyticsformobile/php/ga.php
  • 25× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/mobile-smart/mobile-smart-theme/search.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function language_attributes() in wp-content/plugins/mobile-smart/mobile-smart-theme/header.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_search_form() in wp-content/plugins/mobile-smart/mobile-smart-theme/sidebar.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/mobile-smart/mobile-smart-theme/index.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/mobile-smart/mobile-smart-theme/single.php:1
    • > PHP Notice
      Undefined index: HTTP_X_DCMGUID in wp-content/plugins/mobile-smart/mobile-smart-theme/tools/googleanalyticsformobile/php/ga.php on line 141
    • > PHP Fatal error
      Uncaught Error: Call to undefined function automatic_feed_links() in wp-content/plugins/mobile-smart/mobile-smart-theme/functions.php:8
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_DIR - assumed 'WP_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/mobile-smart/mobile-smart.php on line 40
    • > PHP Notice
      Undefined index: HTTP_ACCEPT_LANGUAGE in wp-content/plugins/mobile-smart/mobile-smart-theme/tools/googleanalyticsformobile/php/ga.php on line 94
    • > PHP Fatal error
      Uncaught Error: Call to undefined function bloginfo() in wp-content/plugins/mobile-smart/mobile-smart-theme/searchform.php:1

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please fix the following user-side errors
    • > GET request to /wp-admin/mobile-smart.php
    • > Network (severe)
    wp-admin/mobile-smart.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 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
Attributes that need to be fixed:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === mobile-smart === )
The official readme.txt might help

mobile-smart/mobile-smart.php 85% from 13 tests

The primary PHP file in "Mobile Smart" version v1.3.16... is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Version: The version number should be digits and periods (ex. "1.0.3" instead of "v1.3.16...")
  • Description: Please keep the plugin description shorter than 140 characters (currently 156 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected13,430 lines of code in 68 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript202,1702,8417,661
PHP206488053,150
HTML103401141,674
CSS612798278
JSP23638202
ASP.NET2373199
Perl24436153
Markdown328087
Bourne Again Shell141514
XML281512

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity133.50
▷ Minimum class complexity2.00
▷ Maximum class complexity223.00
Average method complexity4.55
▷ Minimum method complexity1.00
▷ Maximum method complexity65.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods147
▷ Static methods32.04%
▷ Public methods11578.23%
▷ Protected methods3020.41%
▷ Private methods21.36%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants94
▷ Global constants94100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
10 PNG files occupy 0.04MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
mobile-smart-theme/img/l/splash.png1.87KB1.87KB0.10%
mobile-smart-theme/tools/mobile-bookmark-bubble/images/icon_calendar.png3.67KB2.75KB▼ 25.20%
mobile-smart-theme/screenshot.png4.28KB4.06KB▼ 5.24%
mobile-smart-theme/img/l/apple-touch-icon.png2.38KB1.66KB▼ 30.38%
mobile-smart-theme/img/h/apple-touch-icon.png2.97KB2.24KB▼ 24.53%