66% advanced-angular-contact-form

Code Review | Advanced Angular Contact Form

WordPress plugin Advanced Angular Contact Form scored66%from 54 tests.

About plugin

  • Plugin page: advanced-angular-...
  • Plugin version: 1.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-4.9
  • WordPress version: 6.3.1
  • First release: Feb 27, 2018
  • Latest release: Mar 6, 2018
  • Number of updates: 5
  • Update frequency: every 1.6 days
  • Top authors: Tauhidul Alam (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /858 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: ▲0.04MB] [CPU: ▼2.46ms] Passed 4 tests

Analyzing server-side resources used by Advanced Angular Contact Form
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0541.52 ▲0.88
Dashboard /wp-admin3.35 ▲0.0447.54 ▼5.19
Posts /wp-admin/edit.php3.40 ▲0.0443.75 ▼1.42
Add New Post /wp-admin/post-new.php5.94 ▲0.0593.61 ▼4.09
Media Library /wp-admin/upload.php3.27 ▲0.0435.68 ▲2.57
Edit Form /wp-admin/admin.php?page=ng-edit-form3.2128.71
Add Form /wp-admin/admin.php?page=ng-add-form3.2429.91
All Forms /wp-admin/admin.php?page=ng-forms3.2530.81

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 22 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
ngContact_form_preview_page
widget_recent-posts
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

Advanced Angular Contact Form: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲9414.47 ▲0.111.79 ▲0.0841.41 ▼3.35
Dashboard /wp-admin2,231 ▲405.84 ▲0.0097.06 ▼6.5641.22 ▲2.22
Posts /wp-admin/edit.php2,114 ▲251.99 ▼0.1437.82 ▲0.0631.95 ▼3.63
Add New Post /wp-admin/post-new.php1,558 ▲2418.41 ▼4.94617.23 ▼53.9559.76 ▲5.55
Media Library /wp-admin/upload.php1,407 ▲164.25 ▲0.0796.97 ▼0.3442.17 ▼2.01
Edit Form /wp-admin/admin.php?page=ng-edit-form68218.11676.2220.67
Add Form /wp-admin/admin.php?page=ng-add-form1,04418.87693.8645.70
All Forms /wp-admin/admin.php?page=ng-forms9962.0424.3726.98

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_recent-posts
    • theysaidso_admin_options
    • ngContact_form_preview_page
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/admin.php?page=ng-edit-form
    • > Notice in wp-content/plugins/advanced-angular-contact-form/contact-form.php+882
    Undefined index: id

SRP 0% 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× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/advanced-angular-contact-form/templates/fields/before-form-fields.php
  • 81× 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 esc_html() in wp-content/plugins/advanced-angular-contact-form/templates/fields/select-field.php:16
    • > PHP Notice
      Trying to get property 'hide_label' of non-object in wp-content/plugins/advanced-angular-contact-form/templates/fields/text-field.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/advanced-angular-contact-form/templates/fields/submit-field.php:3
    • > PHP Notice
      Undefined variable: field_object in wp-content/plugins/advanced-angular-contact-form/templates/fields/email-field.php on line 8
    • > PHP Notice
      Undefined variable: field_object in wp-content/plugins/advanced-angular-contact-form/templates/fields/text-field.php on line 14
    • > PHP Notice
      Trying to get property 'required' of non-object in wp-content/plugins/advanced-angular-contact-form/templates/fields/email-field.php on line 8
    • > PHP Notice
      Trying to get property 'required' of non-object in wp-content/plugins/advanced-angular-contact-form/templates/fields/checkbox-field.php on line 13
    • > PHP Notice
      Trying to get property 'required' of non-object in wp-content/plugins/advanced-angular-contact-form/templates/fields/select-field.php on line 13
    • > PHP Notice
      Undefined variable: field_object in wp-content/plugins/advanced-angular-contact-form/templates/fields/radio-field.php on line 2
    • > PHP Notice
      Undefined variable: field_object in wp-content/plugins/advanced-angular-contact-form/templates/fields/checkbox-field.php on line 13

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please take a look at the following user-side issues
    • > GET request to /wp-admin/admin.php?page=ng-edit-form
    • > Console-api (severe) in unknown
    ng:///t/t_Host.ngfactory.js 4:26 "ERROR" Error: The selector "contact-form" did not match any elementsat t.selectRootElement (/wp-content/plugins/advanced-angular-contact-form/dist/app.bundle.js?ver=1.1.1:1:333767)at t.selectRootElement (/wp-content/plugins/advanced-angular-contact-form/dist/app.bundle.js?ver=1.1.1:1:1539083)at t.selectRootElement (/wp-content/plugins/advanced-angular-contact-form/dist/app.bundle.js?ver=1.1.1:1:126882)at hi (/wp-content/plugins/advanced-angular-contact-form/dist/app.bundle.js?ver=1.1.1:1:83093)at zo (/wp-content/plugins/advanced-angular-contact-form/dist/app.bundle.js?ver=1.1.1:1:108740)at No (/wp-content/plugins/advanced-angular-contact-form/dist/app.bundle.js?ver=1.1.1:1:107992)at Rs (/wp-content/plugins/advanced-angular-contact-form/dist/app.bundle.js?ver=1.1.1:1:125057)at Object.rs [as createRootView] (/wp-content/plugins/advanced-angular-contact-form/dist/app.bundle.js?ver=1.1.1:1:118693)at e.create (/wp-content/plugins/advanced-angular-contact-form/dist/app.bundle.js?ver=1.1.1:1:87601)at e.create (/wp-content/plugins/advanced-angular-contact-form/dist/app.bundle.js?ver=1.1.1:1:36382)
    • > GET request to /wp-admin/admin.php?page=ng-edit-form
    • > Console-api (severe) in unknown
    ng:///t/t_Host.ngfactory.js 4:26 "ERROR CONTEXT" t
    • > GET request to /wp-admin/admin.php?page=ng-edit-form
    • > Console-api (severe) in unknown
    /wp-content/plugins/advanced-angular-contact-form/dist/app.bundle.js?ver=1.1.1 0:896190 Error: The selector "contact-form" did not match any elementsat t.selectRootElement (/wp-content/plugins/advanced-angular-contact-form/dist/app.bundle.js?ver=1.1.1:1:333767)at t.selectRootElement (/wp-content/plugins/advanced-angular-contact-form/dist/app.bundle.js?ver=1.1.1:1:1539083)at t.selectRootElement (/wp-content/plugins/advanced-angular-contact-form/dist/app.bundle.js?ver=1.1.1:1:126882)at hi (/wp-content/plugins/advanced-angular-contact-form/dist/app.bundle.js?ver=1.1.1:1:83093)at zo (/wp-content/plugins/advanced-angular-contact-form/dist/app.bundle.js?ver=1.1.1:1:108740)at No (/wp-content/plugins/advanced-angular-contact-form/dist/app.bundle.js?ver=1.1.1:1:107992)at Rs (/wp-content/plugins/advanced-angular-contact-form/dist/app.bundle.js?ver=1.1.1:1:125057)at Object.rs [as createRootView] (/wp-content/plugins/advanced-angular-contact-form/dist/app.bundle.js?ver=1.1.1:1:118693)at e.create (/wp-content/plugins/advanced-angular-contact-form/dist/app.bundle.js?ver=1.1.1:1:87601)at e.create (/wp-content/plugins/advanced-angular-contact-form/dist/app.bundle.js?ver=1.1.1:1:36382)

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention:
  • Screenshots: Screenshot #6 (Short code view of a created form.) image not found
  • Screenshots: Add a description for screenshot #2 in advanced-angular-contact-form/assets to your readme.txt
The official readme.txt is a good inspiration

advanced-angular-contact-form/contact-form.php 85% from 13 tests

The main file in "Advanced Angular Contact Form" v. 1.1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("advanced-angular-contact-form.php" instead of "contact-form.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
Good job! No executable or dangerous file extensions detected1,455 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP132683451,342
CSS4331112
JavaScript2031

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity28.00
▷ Minimum class complexity6.00
▷ Maximum class complexity48.00
Average method complexity2.69
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes133.33%
Methods50
▷ Static methods12.00%
▷ Public methods3570.00%
▷ Protected methods00.00%
▷ Private methods1530.00%
Functions10
▷ Named functions110.00%
▷ Anonymous functions990.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There are no PNG files in this plugin