72% wp-pizzeria

Code Review | WP Pizzeria

WordPress plugin WP Pizzeria scored72%from 54 tests.

About plugin

  • Plugin page: wp-pizzeria
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-3.5.1
  • WordPress version: 6.3.1
  • First release: Feb 5, 2013
  • Latest release: Feb 12, 2013
  • Number of updates: 28
  • Update frequency: every 0.3 days
  • Top authors: david.binda (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /3,153 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
The plugin installed gracefully, with no errors

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

Analyzing server-side resources used by WP Pizzeria
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.63 ▲0.1751.98 ▲11.11
Dashboard /wp-admin3.47 ▲0.1652.96 ▼1.08
Posts /wp-admin/edit.php3.52 ▲0.1650.13 ▼0.41
Add New Post /wp-admin/post-new.php6.05 ▲0.1688.28 ▼7.07
Media Library /wp-admin/upload.php3.39 ▲0.1644.50 ▲10.60
Pizzas /wp-admin/edit.php?post_type=wp_pizzeria_pizza3.3937.60
Add pizza /wp-admin/post-new.php?post_type=wp_pizzeria_pizza3.4953.25
Dessert categories /wp-admin/edit-tags.php?taxonomy=wp_pizzeria_dessert_category&post_type=wp_pizzeria_dessert3.3939.64
Beverages /wp-admin/edit.php?post_type=wp_pizzeria_beverage3.4340.50
Pizza ingredients /wp-admin/edit-tags.php?taxonomy=wp_pizzeria_ingredient&post_type=wp_pizzeria_pizza3.3836.62
Beverage categories /wp-admin/edit-tags.php?taxonomy=wp_pizzeria_beverage_category&post_type=wp_pizzeria_beverage3.3939.18
Add Beverage /wp-admin/post-new.php?post_type=wp_pizzeria_beverage3.4947.71
Add Pasta /wp-admin/post-new.php?post_type=wp_pizzeria_pasta3.4848.37
Pasta categories /wp-admin/edit-tags.php?taxonomy=wp_pizzeria_pasta_category&post_type=wp_pizzeria_pasta3.3936.17
Desserts /wp-admin/edit.php?post_type=wp_pizzeria_dessert3.4339.24

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 31 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by WP Pizzeria
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,056 ▲29513.61 ▼0.5911.78 ▲9.9657.17 ▲16.85
Dashboard /wp-admin2,367 ▲1675.87 ▲0.01108.02 ▼2.0541.93 ▲1.03
Posts /wp-admin/edit.php2,249 ▲1522.02 ▼0.0335.52 ▼4.9433.03 ▼3.53
Add New Post /wp-admin/post-new.php1,648 ▲11717.57 ▼5.77686.23 ▼1.1957.51 ▼1.32
Media Library /wp-admin/upload.php1,549 ▲1494.25 ▲0.01104.03 ▼3.8745.64 ▲0.87
Pizzas /wp-admin/edit.php?post_type=wp_pizzeria_pizza1,2401.9732.9827.03
Add pizza /wp-admin/post-new.php?post_type=wp_pizzeria_pizza2,5877.85176.3364.37
Dessert categories /wp-admin/edit-tags.php?taxonomy=wp_pizzeria_dessert_category&post_type=wp_pizzeria_dessert1,4482.4129.2432.52
Beverages /wp-admin/edit.php?post_type=wp_pizzeria_beverage1,2401.9731.0430.31
Pizza ingredients /wp-admin/edit-tags.php?taxonomy=wp_pizzeria_ingredient&post_type=wp_pizzeria_pizza1,4332.2328.7830.06
Beverage categories /wp-admin/edit-tags.php?taxonomy=wp_pizzeria_beverage_category&post_type=wp_pizzeria_beverage1,4482.3028.9130.68
Add Beverage /wp-admin/post-new.php?post_type=wp_pizzeria_beverage2,5047.61166.5558.16
Add Pasta /wp-admin/post-new.php?post_type=wp_pizzeria_pasta2,5037.78158.9760.22
Pasta categories /wp-admin/edit-tags.php?taxonomy=wp_pizzeria_pasta_category&post_type=wp_pizzeria_pasta1,4482.3227.1832.34
Desserts /wp-admin/edit.php?post_type=wp_pizzeria_dessert1,2431.9532.2131.97

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Almost there, just fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=wp_pizzeria_pizza
    • > Notice in wp-content/plugins/wp-pizzeria/custom-post-type-pizza.php+153
    Undefined index: sizes
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=wp_pizzeria_pasta
    • > Warning in wp-content/plugins/wp-pizzeria/custom-post-type-pasta.php+86
    array_key_exists() expects parameter 2 to be array, bool given

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
Please take a closer look at the following
  • 16× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/wp-pizzeria/wp_pizzeria.php:30
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/wp-pizzeria/beverage-display.php:76
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-pizzeria/taxonomy-pasta-categories.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-pizzeria/custom-post-type-beverage.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/wp-pizzeria/dessert-display.php:76
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-pizzeria/pizza-settings-page.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-pizzeria/taxonomy-beverage-categories.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-pizzeria/taxonomy-dessert-categories.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-pizzeria/custom-post-type-pizza.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/wp-pizzeria/pasta-display.php:76

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
These are user-side errors you should fix
    • > GET request to /wp-admin/post-new.php?post_type=wp_pizzeria_pizza
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1 1:28609 "jQuery.Deferred exception: $(...).live is not a function" "TypeError: $(...).live is not a function\n at HTMLDocument.\u003Canonymous> (/wp-admin/post-new.php?post_type=wp_pizzeria_pizza:433:26)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/post-new.php?post_type=wp_pizzeria_pizza
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1 1:28721 Uncaught TypeError: $(...).live is not a function
    • > GET request to /wp-admin/edit-tags.php?taxonomy=wp_pizzeria_ingredient&post_type=wp_pizzeria_pizza
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: $(...).live is not a function" "TypeError: $(...).live is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/wp-pizzeria/js/upload-image.js?ver=6.3.1:3:18)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/edit-tags.php?taxonomy=wp_pizzeria_ingredient&post_type=wp_pizzeria_pizza
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: $(...).live is not a function

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
8 plugin tags: pizzeria, carte, restaurant, restaurant menu, carte du jour...

wp-pizzeria/wp_pizzeria.php 85% from 13 tests

"WP Pizzeria" version 1.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 272 characters long)
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wp-pizzeria.php" instead of "wp_pizzeria.php")

Code Analysis Passed 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
There were no executable files found in this plugin2,424 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
PHP162331812,257
CSS201590
JavaScript332677

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions78
▷ Named functions78100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
4 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/pasta-icon32.png1.43KB1.10KB▼ 22.66%
img/icon32.png0.97KB1.53KB0.00%
img/beverage-icon32.png1.01KB1.17KB0.00%
img/menu.png6.71KB2.43KB▼ 63.76%