84% lwn-recipe

Code Review | LWN Recipe

WordPress plugin LWN Recipe scored 84% from 54 tests.

About plugin

  • Plugin page: lwn-recipe
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.1
  • WordPress version: 6.3.1
  • First release: Mar 8, 2023
  • Latest release: Mar 8, 2023
  • Number of updates: 8
  • Update frequency: N/A
  • Top authors: Nawras92 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 94 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.16MB] [CPU: ▼1.63ms] Passed 4 tests

This is a short check of server-side resources used by LWN Recipe
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.63 ▲0.1738.37 ▲0.30
Dashboard /wp-admin3.46 ▲0.1551.72 ▲7.76
Posts /wp-admin/edit.php3.57 ▲0.2246.48 ▼4.22
Add New Post /wp-admin/post-new.php6.04 ▲0.1583.40 ▼9.20
Media Library /wp-admin/upload.php3.38 ▲0.1549.66 ▲6.62
Recipe Type /wp-admin/edit-tags.php?taxonomy=lwn_recipe_type&post_type=lwn_recipe3.3835.79
Add New /wp-admin/post-new.php?post_type=lwn_recipe3.5248.58
LWN Recipes /wp-admin/options-general.php?page=lwn-recipe-plugin3.3530.16
LWN Recipes /wp-admin/edit.php?post_type=lwn_recipe3.4235.80

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 32 new files
Database: no new tables, 8 new options
New WordPress options
db_upgraded
widget_recent-posts
widget_lwn_recipe_latest_recipes
theysaidso_admin_options
widget_recent-comments
widget_lwn_recipe_recipe_types
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for LWN Recipe
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,869 ▲13413.72 ▼0.671.79 ▲0.1442.54 ▼4.95
Dashboard /wp-admin2,247 ▲564.87 ▼0.0096.56 ▼2.2942.34 ▼3.75
Posts /wp-admin/edit.php2,130 ▲411.99 ▼0.0633.35 ▼12.3836.73 ▼0.29
Add New Post /wp-admin/post-new.php1,548 ▲1418.14 ▼4.87663.88 ▼13.8954.26 ▼11.71
Media Library /wp-admin/upload.php1,429 ▲414.15 ▼0.02105.24 ▲2.1543.29 ▼0.96
Recipe Type /wp-admin/edit-tags.php?taxonomy=lwn_recipe_type&post_type=lwn_recipe1,3002.1425.4826.05
Add New /wp-admin/post-new.php?post_type=lwn_recipe2,9618.63170.2468.66
LWN Recipes /wp-admin/options-general.php?page=lwn-recipe-plugin9712.0221.5327.09
LWN Recipes /wp-admin/edit.php?post_type=lwn_recipe1,1371.9432.0630.62

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
  • The uninstall procedure has failed, leaving 8 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_lwn_recipe_recipe_types
    • widget_recent-comments
    • widget_lwn_recipe_latest_recipes
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 12× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function language_attributes() in wp-content/plugins/lwn-recipe/templates/single-lwn_recipe.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/lwn-recipe/includes/register-widgets.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/lwn-recipe/admin/admin-config.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/lwn-recipe/lwn-recipe.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/lwn-recipe/includes/display-recipe-template.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function language_attributes() in wp-content/plugins/lwn-recipe/templates/archive-lwn_recipe.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/lwn-recipe/includes/register-recipe-type.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/lwn-recipe/includes/register-recipe-taxonomy.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/lwn-recipe/includes/register-recipe-metabox.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/lwn-recipe/includes/register-sidebar.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
5 plugin tags: food, cook, recipes, kitchens, restaurants

lwn-recipe/lwn-recipe.php 85% from 13 tests

The main PHP file in "LWN Recipe" ver. 1.0.0 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Requires PHP: The required version number must match the one declared in readme.txt ("5.3" instead of "7.2")
  • Requires at least: The required version number must match the one declared in readme.txt ("5.0" instead of "5.2")

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
No dangerous file extensions were detected1,650 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
PHP14119431,124
CSS61919336
PO File17884190

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.16
Average class complexity10.50
▷ Minimum class complexity9.00
▷ Maximum class complexity12.00
Average method complexity3.38
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions23
▷ Named functions23100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There were not PNG files found in your plugin