72% wp-dev-powers-display-screen-dimensions-to-admin

Code Review | WP Dev Powers - Display Screen Dimensions to Admin Plugin

WordPress plugin WP Dev Powers - Display Screen Dimensions to Admin Plugin scored 72% from 54 tests.

About plugin

  • Plugin page: wp-dev-powers-dis...
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress version: 5.9.2
  • First release: Sep 5, 2019
  • Latest release: Sep 5, 2019
  • Number of updates: 5
  • Update frequency: every 0.2 days
  • Top authors: wpdevpowers (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 285 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.46MB] [CPU: ▼307.08ms] Passed 4 tests

An overview of server-side resources used by WP Dev Powers - Display Screen Dimensions to Admin Plugin
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.04 ▲0.5387.38 ▼1.22
Dashboard /wp-admin3.88 ▲0.4737.09 ▲2.24
Posts /wp-admin/edit.php4.11 ▲0.4737.71 ▼3.43
Add New Post /wp-admin/post-new.php7.33 ▲0.3694.02 ▼1,225.89
Media Library /wp-admin/upload.php3.82 ▲0.5334.57 ▲8.66
Freemius Debug [v.2.3.0] /wp-admin/admin.php?page=freemius4.0224.19

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 221 new files
Database: no new tables, 5 new options
New WordPress options
fs_active_plugins
fs_debug_mode
fs_api_cache
fs_gdpr
fs_accounts

Browser metrics Passed 4 tests

An overview of browser requirements for WP Dev Powers - Display Screen Dimensions to Admin Plugin
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,049 ▲29515.25 ▲0.126.74 ▲0.222.22 ▼0.67
Dashboard /wp-admin3,119 ▲2656.16 ▼0.06134.24 ▲9.21221.92 ▲60.59
Posts /wp-admin/edit.php2,866 ▲1753.25 ▲0.0164.30 ▼0.65163.48 ▲17.77
Add New Post /wp-admin/post-new.php1,756 ▲9517.63 ▲0.88431.58 ▲14.69324.25 ▲134.56
Media Library /wp-admin/upload.php1,944 ▲2525.53 ▲0.03140.34 ▼14.13177.58 ▼65.23
Freemius Debug [v.2.3.0] /wp-admin/admin.php?page=freemius1,5632.7096.20159.43

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Zombie WordPress options were found after uninstall: 5 options
    • fs_accounts
    • fs_api_cache
    • fs_debug_mode
    • fs_active_plugins
    • fs_gdpr

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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
The following issues need your attention
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/wp-dev-powers-display-screen-dimensions-to-admin/freemius/templates/ajax-loader.php
  • 15× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/wp-dev-powers-display-screen-dimensions-to-admin/freemius/templates/account/partials/addon.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/wp-dev-powers-display-screen-dimensions-to-admin/php/admin-header.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-dev-powers-display-screen-dimensions-to-admin/php/core.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function freemius() in wp-content/plugins/wp-dev-powers-display-screen-dimensions-to-admin/freemius/templates/partials/network-activation.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function dsdta_fs() in wp-content/plugins/wp-dev-powers-display-screen-dimensions-to-admin/php/header.php:15
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/wp-dev-powers-display-screen-dimensions-to-admin/freemius/templates/account/partials/addon.php on line 8
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/wp-dev-powers-display-screen-dimensions-to-admin/freemius/templates/account/partials/addon.php on line 7
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wp-dev-powers-display-screen-dimensions-to-admin/freemius/templates/account/partials/addon.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_slug() on null in wp-content/plugins/wp-dev-powers-display-screen-dimensions-to-admin/freemius/templates/account/partials/addon.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/wp-dev-powers-display-screen-dimensions-to-admin/php/freemius-integration.php:14

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There are user-side issues you should fix
    • > GET request to /wp-admin/admin.php?page=freemius
    • > Network (severe)
    https://maxcdn.bootstrapcdn.com/font-awesome/5.4.0/css/font-awesome.min.css?ver=5.9.2 - Failed to load resource: the server responded with a status of 404 ()

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed:
  • Tags: You are using too many tags: 12 tag instead of maximum 10
The official readme.txt is a good inspiration

wp-dev-powers-display-screen-dimensions-to-admin/index.php 85% from 13 tests

"WP Dev Powers - Display Screen Dimensions to Admin Plugin" version 1.0.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wp-dev-powers-display-screen-dimensions-to-admin.php" instead of "index.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis 97% from 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
Everything looks great! No dangerous files found in this plugin43,609 lines of code in 169 files:
LanguageFilesBlank linesComment linesLines of code
PHP1126,73015,43728,323
PO File105,7106,91312,558
Sass28399772,515
JavaScript63459197
CSS130016

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Please tend to the following items
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 2,609)
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity82.93
▷ Minimum class complexity1.00
▷ Maximum class complexity2,609.00
Average method complexity4.52
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes45
▷ Abstract classes24.44%
▷ Concrete classes4395.56%
▷ Final classes00.00%
Methods1,080
▷ Static methods17015.74%
▷ Public methods74969.35%
▷ Protected methods151.39%
▷ Private methods31629.26%
Functions104
▷ Named functions104100.00%
▷ Anonymous functions00.00%
Constants120
▷ Global constants9780.83%
▷ Class constants2319.17%
▷ Public constants23100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
11 PNG files occupy 0.16MB with 0.06MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/overlay.png0.11KB0.15KB0.00%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
dashicon.png2.44KB1.54KB▼ 36.84%
images/conditional-logic.png3.26KB0.80KB▼ 75.43%