84% nginx-mobile-theme

Code Review | Nginx Mobile Theme

WordPress plugin Nginx Mobile Theme scored 84% from 54 tests.

About plugin

  • Plugin page: nginx-mobile-theme
  • Plugin version: 1.8.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7.1-4.9.8
  • WordPress version: 6.3.1
  • First release: Nov 8, 2013
  • Latest release: Oct 17, 2018
  • Number of updates: 27
  • Update frequency: every 66.8 days
  • Top authors: miyauchi (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

300+ active / 139,542 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.07MB] [CPU: ▼4.04ms] Passed 4 tests

This is a short check of server-side resources used by Nginx Mobile Theme
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0740.97 ▼2.31
Dashboard /wp-admin3.38 ▲0.0846.89 ▼0.89
Posts /wp-admin/edit.php3.50 ▲0.1449.93 ▲0.22
Add New Post /wp-admin/post-new.php5.96 ▲0.0787.49 ▼13.16
Media Library /wp-admin/upload.php3.31 ▲0.0736.52 ▲2.17

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 18 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Nginx Mobile Theme
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,811 ▲6513.37 ▼1.001.61 ▼0.2640.35 ▲1.01
Dashboard /wp-admin2,217 ▲294.84 ▼0.05113.18 ▲2.5544.37 ▲5.39
Posts /wp-admin/edit.php2,100 ▲112.06 ▲0.0440.39 ▼3.2837.64 ▲1.42
Add New Post /wp-admin/post-new.php1,549 ▲3023.60 ▲0.27692.04 ▲10.8255.23 ▼7.80
Media Library /wp-admin/upload.php1,396 ▲54.17 ▼0.0397.59 ▼5.4042.35 ▼1.51

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
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 50% 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
The following issues need your attention
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/nginx-mobile-theme/nginx-mobile-theme.php:39
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Customize_Control' not found in wp-content/plugins/nginx-mobile-theme/vendor/megumi/theme_customizer_control/lib/Megumi/ThemeCustomizerControl.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 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
8 plugin tags: nginx, theme, tablet, iphone, smartphone...

nginx-mobile-theme/nginx-mobile-theme.php Passed 13 tests

The entry point to "Nginx Mobile Theme" version 1.8.2 is a PHP file that has certain tags in its header comment area
94 characters long description:
This plugin allows you to switch theme according to the User Agent on the Nginx reverse proxy.

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
No dangerous file extensions were detected814 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP9121309626
JSON410110
Markdown233078

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity19.20
▷ Minimum class complexity6.00
▷ Maximum class complexity39.00
Average method complexity2.84
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods40
▷ Static methods25.00%
▷ Public methods3587.50%
▷ Protected methods12.50%
▷ Private methods410.00%
Functions6
▷ Named functions233.33%
▷ Anonymous functions466.67%
Constants0
▷ Global constants00.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
PNG images were not found in this plugin