10% my-preferences-woo

Code Review | My Preferences

WordPress plugin My Preferences scored 10% from 54 tests.

About plugin

  • Plugin page: my-preferences-woo
  • Plugin version: 1.0.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.7.2
  • WordPress version: 5.8.1
  • First release: Jul 22, 2021
  • Latest release: Jul 22, 2021
  • Number of updates: 3
  • Update frequency: every 0.7 days
  • Top authors: leadsoft (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 56 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
It is recommended to fix the following installer errors
  • The plugin cannot be installed
    • > Deprecated in wp-includes/class-wp-hook.php+303
    Non-static method MyPreferences_PRLS::activate() should not be called statically

Server metrics [RAM: ▲0.10MB] [CPU: ▼143.16ms] Passed 4 tests

A check of server-side resources used by My Preferences
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.99 ▲0.2644.67 ▲15.62
Dashboard /wp-admin3.15 ▲0.0943.22 ▲0.21
Posts /wp-admin/edit.php3.26 ▲0.1545.54 ▼4.88
Add New Post /wp-admin/post-new.php5.51 ▲0.0796.16 ▼568.34
Media Library /wp-admin/upload.php3.09 ▲0.0934.83 ▲0.38
Import Items /wp-admin/admin.php?page=myprefs-settings-import3.0630.46
My Preferences /wp-admin/admin.php?page=myprefs-settings3.0629.66

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 43 new files
Database: 3 new tables, 1 new option
New tables
oo_item_preftypes
oo_items
oo_preferences
New WordPress options
myprefs_page_id

Browser metrics Passed 4 tests

An overview of browser requirements for My Preferences
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,854 ▲25816.58 ▲0.9022.00 ▲13.7749.67 ▼4.29
Dashboard /wp-admin3,003 ▲725.89 ▼0.05145.50 ▼6.17123.44 ▲1.05
Posts /wp-admin/edit.php2,773 ▲342.70 ▲0.0170.12 ▲5.3497.35 ▼10.65
Add New Post /wp-admin/post-new.php1,705 ▲11118.50 ▼0.38397.72 ▲6.08113.56 ▼2.33
Media Library /wp-admin/upload.php1,782 ▼285.00 ▼0.04169.41 ▲15.41126.28 ▼4.23
Import Items /wp-admin/admin.php?page=myprefs-settings-import1,2162.2269.7798.44
My Preferences /wp-admin/admin.php?page=myprefs-settings1,0702.0957.0872.44

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Zombie tables detected upon uninstall: 3 tables
    • oo_preferences
    • oo_items
    • oo_item_preftypes
  • Zombie WordPress options were found after uninstall: 1 option
    • myprefs_page_id

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

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
Almost there! Just fix the following items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function sanitize_text_field() in wp-content/plugins/my-preferences-woo/views/user-preferences.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (The screenshot description corresponds to front-page.png), #2 (The screenshot description corresponds to import.png), #3 (The screenshot description corresponds to items_sheet.png), #4 (The screenshot description corresponds to setting.png)
  • Contributors: The plugin contributors field is missing
The official readme.txt is a good inspiration

my-preferences-woo/woocommerce-my-preferences.php 85% from 13 tests

The main PHP file in "My Preferences" ver. 1.0.2 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("my-preferences-woo.php" instead of "woocommerce-my-preferences.php")
  • Description: The description should be shorter than 140 characters (currently 160 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected1,488 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP15196381,138
JavaScript16756349
CSS1001

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity13.78
▷ Minimum class complexity1.00
▷ Maximum class complexity43.00
Average method complexity2.47
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods78
▷ Static methods00.00%
▷ Public methods5773.08%
▷ Protected methods2126.92%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
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
8 PNG files occupy 0.31MB with 0.20MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
import.png36.12KB13.52KB▼ 62.56%
assets/img/cats_sheet.png45.97KB18.36KB▼ 60.07%
front-page.png61.46KB20.61KB▼ 66.47%
assets/img/items_txt.png20.54KB5.11KB▼ 75.14%
assets/img/items_sheet.png47.50KB19.18KB▼ 59.63%