72% wpscreens

Code Review | WPScreens

WordPress plugin WPScreens scored72%from 54 tests.

About plugin

  • Plugin page: wpscreens
  • Plugin version: 2.1
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.2
  • WordPress version: 6.3.1
  • First release: Jul 17, 2020
  • Latest release: Jun 14, 2023
  • Number of updates: 116
  • Update frequency: every 9.2 days
  • Top authors: wpscreens (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

300+ active /6,371 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲1.22MB] [CPU: ▲0.70ms] Passed 4 tests

A check of server-side resources used by WPScreens
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.62 ▲1.1641.54 ▲2.46
Dashboard /wp-admin4.52 ▲1.2147.31 ▼3.97
Posts /wp-admin/edit.php4.57 ▲1.2158.65 ▲11.43
Add New Post /wp-admin/post-new.php7.20 ▲1.3196.73 ▼2.05
Media Library /wp-admin/upload.php4.53 ▲1.3043.26 ▲6.38
New WPSplitscreen /wp-admin/post-new.php?post_type=split_displays4.6653.81
Add New /wp-admin/post-new.php?post_type=acf-field-group4.6751.22
Field Groups /wp-admin/edit.php?post_type=acf-field-group4.5136.74
WP Screens /wp-admin/options-general.php?page=wpscreens4.3233.37
New WPScreen /wp-admin/post-new.php?post_type=displays4.6154.18
All WPSplitscreens /wp-admin/edit.php?post_type=split_displays4.4837.62
Tools /wp-admin/edit.php?post_type=acf-field-group&page=acf-tools4.4735.13
All WPScreens /wp-admin/edit.php?post_type=displays4.4836.61

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 304 new files
Database: no new tables, 8 new options
New WordPress options
can_compress_scripts
acf_version
widget_recent-posts
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
wpscreens_option_name

Browser metrics Passed 4 tests

Checking browser requirements for WPScreens
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,974 ▲23913.70 ▼0.675.91 ▲3.9339.35 ▼8.21
Dashboard /wp-admin2,285 ▲974.86 ▼0.03109.31 ▲9.1142.71 ▼2.43
Posts /wp-admin/edit.php2,168 ▲792.04 ▼0.0239.75 ▲2.2033.01 ▼0.28
Add New Post /wp-admin/post-new.php11,364 ▲9,83126.59 ▲3.461,164.02 ▲482.6337.21 ▼22.11
Media Library /wp-admin/upload.php2,009 ▲6218.40 ▲4.10231.00 ▲126.2851.31 ▲5.85
New WPSplitscreen /wp-admin/post-new.php?post_type=split_displays2,4788.13178.8138.25
Add New /wp-admin/post-new.php?post_type=acf-field-group2,3443.8384.7446.46
Field Groups /wp-admin/edit.php?post_type=acf-field-group1,2432.1032.0928.22
WP Screens /wp-admin/options-general.php?page=wpscreens8971.7125.5226.13
New WPScreen /wp-admin/post-new.php?post_type=displays2,2828.00174.2889.95
All WPSplitscreens /wp-admin/edit.php?post_type=split_displays1,1381.9530.7832.72
Tools /wp-admin/edit.php?post_type=acf-field-group&page=acf-tools1,1913.1047.5631.28
All WPScreens /wp-admin/edit.php?post_type=displays1,1352.0032.6129.12

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 8 options
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • acf_version
    • widget_theysaidso_widget
    • wpscreens_option_name

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=wpscreens
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=wpscreens
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/wpscreens/public/partials/wp-screens-public-display.php
    • > /wp-content/plugins/wpscreens/admin/partials/wp-screens-admin-display.php
  • 86× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wpscreens/includes/acf/includes/forms/form-comment.php:34
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wpscreens/includes/acf/includes/admin/views/html-location-rule.php on line 4
    • > PHP Notice
      Undefined variable: active in wp-content/plugins/wpscreens/includes/acf/includes/admin/views/html-admin-tools.php on line 16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function acf_register_store() in wp-content/plugins/wpscreens/includes/acf/includes/acf-form-functions.php:4
    • > PHP Notice
      Undefined variable: rule in wp-content/plugins/wpscreens/includes/acf/includes/admin/views/html-location-rule.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wpscreens/includes/acf.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field' not found in wp-content/plugins/wpscreens/includes/acf/includes/fields/class-acf-field-checkbox.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wpscreens/includes/acf/includes/forms/form-widget.php:40
    • > PHP Fatal error
      Uncaught Error: Class 'acf_field_number' not found in wp-content/plugins/wpscreens/includes/acf/includes/fields/class-acf-field-range.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/wpscreens/includes/acf/includes/api/api-helpers.php:93

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Please fix the following attributes:
  • Screenshots: Add descriptions for screenshots #3, #4, #5, #6 in wpscreens/assets to your readme.txt
  • Donate link: Please fix this invalid URI: "wpscreens.com"
You can look at the official readme.txt

wpscreens/wp-screens.php 85% from 13 tests

This is the main PHP file of "WPScreens" version 2.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wpscreens.php" instead of "wp-screens.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected102,173 lines of code in 248 files:
LanguageFilesBlank linesComment linesLines of code
PO File3123,67740,07449,025
JavaScript246,1605,90324,993
PHP16311,93420,83420,958
CSS235648497,066
Markdown3510102
SVG40229

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity15.41
▷ Minimum class complexity1.00
▷ Maximum class complexity121.00
Average method complexity3.05
▷ Minimum method complexity1.00
▷ Maximum method complexity42.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes119
▷ Abstract classes21.68%
▷ Concrete classes11798.32%
▷ Final classes00.00%
Methods837
▷ Static methods30.36%
▷ Public methods82999.04%
▷ Protected methods00.00%
▷ Private methods80.96%
Functions468
▷ Named functions468100.00%
▷ Anonymous functions00.00%
Constants20
▷ Global constants20100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
10 compressed PNG files occupy 0.23MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/acf/assets/inc/datepicker/images/ui-icons_DDDDDD_256x240.png3.68KB4.17KB0.00%
assets/pro.png204.78KB85.44KB▼ 58.28%
includes/acf/assets/inc/select2/3/select2.png0.51KB0.99KB0.00%
assets/icon-256x256.png7.05KB7.32KB0.00%
includes/acf/assets/inc/select2/3/select2x2.png0.64KB0.77KB0.00%