72% margarita

Code Review | Custom Post Type, Custom Fields and Custom Taxonomies - Margarita

WordPress plugin Custom Post Type, Custom Fields and Custom Taxonomies - Margarita scored 72% from 54 tests.

About plugin

  • Plugin page: margarita
  • Plugin version: 1.2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.6.1
  • WordPress version: 5.9.2
  • First release: Nov 4, 2016
  • Latest release: Nov 4, 2016
  • Number of updates: 5
  • Update frequency: every 5.6 days
  • Top authors: emarket-design (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 762 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.35MB] [CPU: ▼297.64ms] 75% from 4 tests

An overview of server-side resources used by Custom Post Type, Custom Fields and Custom Taxonomies - Margarita
The following require your attention
  • CPU: Total CPU usage should be kept under 500.00ms (currently 642.05ms on /wp-admin/admin.php?page=margarita_store)
PageMemory (MB)CPU Time (ms)
Home /3.87 ▲0.3656.72 ▲3.68
Dashboard /wp-admin3.76 ▲0.3535.11 ▲0.12
Posts /wp-admin/edit.php4.01 ▲0.3740.70 ▼12.28
Add New Post /wp-admin/post-new.php7.31 ▲0.3496.55 ▼1,176.90
Media Library /wp-admin/upload.php3.71 ▲0.4127.07 ▼1.48
Add New /wp-admin/post-new.php?post_type=emd_basic_calcs3.8838.49
Add New /wp-admin/post-new.php?post_type=emd_contact3.9547.26
All Basic Calculations /wp-admin/edit.php?post_type=emd_basic_calcs3.7829.55
Support /wp-admin/admin.php?page=margarita_support3.72636.52
Glossary /wp-admin/admin.php?page=margarita3.6125.16
Contact Category /wp-admin/edit-tags.php?taxonomy=contact_category&post_type=emd_contact3.7127.26
All Contacts /wp-admin/edit.php?post_type=emd_contact3.7829.26
Settings /wp-admin/admin.php?page=margarita_settings3.6123.54
Contact Tags /wp-admin/edit-tags.php?taxonomy=contact_tag&post_type=emd_contact3.7230.25
Add-Ons /wp-admin/admin.php?page=margarita_store3.73642.05

Server storage [IO: ▲0.69MB] [DB: ▲0.02MB] Passed 3 tests

Filesystem and database footprint
This plugin installed successfully
Filesystem: 142 new files
Database: no new tables, 7 new options
New WordPress options
margarita_version
margarita_emd_contact_terms_init
margarita_attr_list
emd_licenses
margarita_shc_list
margarita_tax_list
margarita_ent_list

Browser metrics Passed 4 tests

An overview of browser requirements for Custom Post Type, Custom Fields and Custom Taxonomies - Margarita
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,906 ▲18415.81 ▼0.186.36 ▲0.652.35 ▼0.22
Dashboard /wp-admin3,030 ▲1696.16 ▼0.02121.65 ▼9.69157.48 ▲4.91
Posts /wp-admin/edit.php2,829 ▲1383.26 ▲0.0262.93 ▼1.86141.81 ▼1.65
Add New Post /wp-admin/post-new.php1,748 ▲8716.42 ▲0.12407.99 ▲18.26151.49 ▼0.55
Media Library /wp-admin/upload.php1,831 ▲1335.56 ▲0.09135.97 ▼7.50184.51 ▼14.64
Add New /wp-admin/post-new.php?post_type=emd_basic_calcs2,1724.97175.87116.73
Add New /wp-admin/post-new.php?post_type=emd_contact2,5204.6386.83141.09
All Basic Calculations /wp-admin/edit.php?post_type=emd_basic_calcs1,5143.1861.39110.91
Support /wp-admin/admin.php?page=margarita_support1,6132.4454.49165.74
Glossary /wp-admin/admin.php?page=margarita1,4402.7153.02108.37
Contact Category /wp-admin/edit-tags.php?taxonomy=contact_category&post_type=emd_contact1,9202.7855.99135.69
All Contacts /wp-admin/edit.php?post_type=emd_contact1,6303.2060.03113.68
Settings /wp-admin/admin.php?page=margarita_settings1,2432.5553.22127.12
Contact Tags /wp-admin/edit-tags.php?taxonomy=contact_tag&post_type=emd_contact2,1072.8157.42137.27
Add-Ons /wp-admin/admin.php?page=margarita_store1,6332.4758.59132.30

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Zombie WordPress options were found after uninstall: 2 options
    • emd_licenses
    • margarita_version

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
Please fix the following server-side errors
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=emd_basic_calcs
    • > User notice in wp-includes/functions.php+5768
    WP_Scripts::localize was called incorrectly. The $l10n parameter must be an array. To pass arbitrary data to scripts, use the wp_add_inline_script() function instead. Please see Debugging in WordPress for more information. (This message was added in version 5.7.0.)
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=emd_basic_calcs
    • > Warning in wp-content/plugins/margarita/includes/calculate-functions.php+35
    A non-numeric value encountered
    • > GET request to /wp-admin/post-new.php?post_type=emd_basic_calcs
    • > Warning in wp-content/plugins/margarita/includes/calculate-functions.php+35
    Division by zero

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 fix the following
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'EMD_MB_Field' not found in wp-content/plugins/margarita/assets/ext/emd-meta-box/inc/fields/file-input.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/margarita/assets/ext/emd-meta-box/inc/init.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/margarita/layouts/single-emd-contact.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/margarita/layouts/single-emd-basic-calcs.php:1

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following browser errors
    • > GET request to /wp-admin/admin.php?page=margarita_store
    • > Network (severe)
    https://emdplugins.com/wp-content/uploads/images/logos/wpcontact-arch-320x200.gif - Failed to load resource: the server responded with a status of 404 ()
    • > GET request to /wp-admin/admin.php?page=margarita_store
    • > Network (severe)
    https://emdplugins.com/wp-content/uploads/images/logos/spotlight-arch-300x200.png - Failed to load resource: the server responded with a status of 404 ()
    • > GET request to /wp-admin/admin.php?page=margarita_store
    • > Network (severe)
    https://emdplugins.com/wp-content/uploads/images/logos/wpticket-arch-320x200.gif - Failed to load resource: the server responded with a status of 404 ()
    • > GET request to /wp-admin/admin.php?page=margarita_store
    • > Network (severe)
    https://emdplugins.com/wp-content/uploads/images/logos/youtubesc-arch-320x200.gif - Failed to load resource: the server responded with a status of 404 ()
    • > GET request to /wp-admin/admin.php?page=margarita_store
    • > Network (severe)
    https://emdplugins.com/wp-content/uploads/images/logos/emddir-arch-300x200.gif - Failed to load resource: the server responded with a status of 404 ()
    • > GET request to /wp-admin/admin.php?page=margarita_store
    • > Network (severe)
    https://emdplugins.com/wp-content/uploads/images/logos/sim-arch-320x200.gif - Failed to load resource: the server responded with a status of 404 ()
    • > GET request to /wp-admin/admin.php?page=margarita_store
    • > Network (severe)
    https://emdplugins.com/wp-content/uploads/images/logos/kcenter-arch-300x200.gif - Failed to load resource: the server responded with a status of 404 ()
    • > GET request to /wp-admin/admin.php?page=margarita_store
    • > Network (severe)
    https://emdplugins.com/wp-content/uploads/images/logos/campusdir-arch-300x200.png - Failed to load resource: the server responded with a status of 404 ()
    • > GET request to /wp-admin/admin.php?page=margarita_store
    • > Network (severe)
    https://emdplugins.com/wp-content/uploads/images/logos/wpee-arch-300x200.gif - Failed to load resource: the server responded with a status of 404 ()

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Screenshots: Add a description for screenshot #6 in margarita/assets to your readme.txt
The official readme.txt might help

margarita/margarita.php Passed 13 tests

"Custom Post Type, Custom Fields and Custom Taxonomies - Margarita" version 1.2.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
132 characters long description:
Margarita is a demo app showcasing basic capabilities of WP App Studio. Margarita can be implemented using FreeDev Development plan.

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
Success! There were no dangerous files found in this plugin9,992 lines of code in 121 files:
LanguageFilesBlank linesComment linesLines of code
PHP686392,7227,371
JavaScript312412571,579
CSS2276451,042

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.47
Average class complexity14.66
▷ Minimum class complexity1.00
▷ Maximum class complexity83.00
Average method complexity3.72
▷ Minimum method complexity1.00
▷ Maximum method complexity41.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes53
▷ Abstract classes00.00%
▷ Concrete classes53100.00%
▷ Final classes11.89%
Methods266
▷ Static methods19372.56%
▷ Public methods25796.62%
▷ Protected methods20.75%
▷ Private methods72.63%
Functions56
▷ Named functions56100.00%
▷ Anonymous functions00.00%
Constants15
▷ Global constants15100.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
15 compressed PNG files occupy 0.02MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/ext/emd-meta-box/img/jqueryui/ui-bg_glass_75_dadada_1x400.png0.11KB0.16KB0.00%
assets/ext/emd-meta-box/img/jqueryui/ui-icons_222222_256x240.png4.27KB4.11KB▼ 3.78%
assets/ext/emd-meta-box/css/select2/select2.png0.60KB0.99KB0.00%
assets/ext/emd-meta-box/img/jqueryui/ui-icons_cd0a0a_256x240.png4.27KB4.11KB▼ 3.78%
assets/ext/emd-meta-box/img/jqueryui/ui-bg_highlight-soft_75_cccccc_1x100.png0.10KB0.17KB0.00%