84% wp-is-mobile-text-widget

Code Review | WP Is Mobile Text Widget

WordPress plugin WP Is Mobile Text Widget scored84%from 54 tests.

About plugin

  • Plugin page: wp-is-mobile-text...
  • Plugin version: 1.2.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.2.0
  • WordPress version: 6.3.1
  • First release: Aug 26, 2014
  • Latest release: Apr 13, 2023
  • Number of updates: 28
  • Update frequency: every 112.6 days
  • Top authors: thingsym (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /3,016 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼6.23ms] Passed 4 tests

An overview of server-side resources used by WP Is Mobile Text Widget
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0441.07 ▲2.10
Dashboard /wp-admin3.35 ▲0.0049.85 ▼11.27
Posts /wp-admin/edit.php3.40 ▲0.0444.40 ▼1.76
Add New Post /wp-admin/post-new.php5.93 ▲0.0484.10 ▼13.97
Media Library /wp-admin/upload.php3.27 ▲0.0438.71 ▲4.22

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 8 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
db_upgraded
widget_wp_is_mobile_text
widget_recent-posts

Browser metrics Passed 4 tests

WP Is Mobile Text Widget: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲2913.22 ▼1.421.77 ▼0.1545.24 ▲2.14
Dashboard /wp-admin2,203 ▲115.84 ▲0.8499.24 ▼4.9840.94 ▲4.31
Posts /wp-admin/edit.php2,086 ▲152.00 ▼0.0235.59 ▼1.3731.28 ▼1.71
Add New Post /wp-admin/post-new.php1,514 ▲11717.75 ▼0.04658.36 ▲47.5868.69 ▲10.78
Media Library /wp-admin/upload.php1,382 ▼64.21 ▲0.0195.33 ▼1.1242.87 ▼3.77

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_wp_is_mobile_text
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/wp-is-mobile-text-widget/inc/class-wp-is-mobile-text-widget.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: Add an image for screenshot #1 (WP Is Mobile Text Widget)
You can take inspiration from this readme.txt

wp-is-mobile-text-widget/wp-is-mobile-text-widget.php Passed 13 tests

The main file in "WP Is Mobile Text Widget" v. 1.2.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
132 characters long description:
This WordPress plugin adds text widget that switched display text using wp_is_mobile() function whether the device is mobile or not.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin168 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP233135129
PO File1131639

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity21.00
▷ Minimum class complexity21.00
▷ Maximum class complexity21.00
Average method complexity4.33
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods6100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.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.02MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png19.45KB6.22KB▼ 68.01%