83% walnutmarketing

Code Review | Walnut.Marketing Portal

WordPress plugin Walnut.Marketing Portal scored83%from 54 tests.

About plugin

  • Plugin page: walnutmarketing
  • Plugin version: 0.2.05
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: May 24, 2017
  • Latest release: Mar 18, 2019
  • Number of updates: 81
  • Update frequency: every 8.2 days
  • Top authors: Poniard (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,544 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.17MB] [CPU: ▲385.68ms] 75% from 4 tests

Server-side resources used by Walnut.Marketing Portal
It is recommended to improve the following
  • Extra CPU: Extra CPU usage must be kept under 200.00ms (currently 385.68ms on /wp-admin/options-general.php?page=walnut_options)
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0844.37 ▲2.81
Dashboard /wp-admin3.43 ▲0.13638.79 ▲592.93
Posts /wp-admin/edit.php3.48 ▲0.13606.94 ▲557.18
Add New Post /wp-admin/post-new.php4.94 ▼0.94554.83 ▲454.24
Media Library /wp-admin/upload.php3.29 ▲0.07564.51 ▲528.50
Walnut Marketing /wp-admin/options-general.php?page=walnut_options3.26433.47

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 26 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
walnut_version
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Walnut.Marketing Portal
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,216 ▲48115.83 ▲1.2546.48 ▲44.6544.66 ▲0.47
Dashboard /wp-admin2,221 ▲364.97 ▼0.8599.52 ▼1.6551.48 ▲8.37
Posts /wp-admin/edit.php2,104 ▲152.19 ▲0.1737.22 ▼2.7732.68 ▼6.05
Add New Post /wp-admin/post-new.php6,235 ▲4,69326.39 ▲8.17954.88 ▲353.4540.67 ▼9.21
Media Library /wp-admin/upload.php1,400 ▲154.21 ▲0.06100.70 ▲2.5543.47 ▲0.05
Walnut Marketing /wp-admin/options-general.php?page=walnut_options9011.7424.9424.87

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
The following items require your attention
  • The uninstall procedure has failed, leaving 7 options in the database
    • walnut_version
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 5× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function WalnutMarketing\\add_action() in wp-content/plugins/walnutmarketing/landing-pages.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function WalnutMarketing\\plugin_dir_path() in wp-content/plugins/walnutmarketing/WalnutMarketing.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/walnutmarketing/partials/tinymce-editor.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function WalnutMarketing\\add_shortcode() in wp-content/plugins/walnutmarketing/class-SCCollector.php:114
    • > PHP Fatal error
      Uncaught Error: Call to undefined function WalnutMarketing\\add_action() in wp-content/plugins/walnutmarketing/linked-forms.php:361

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that need to be fixed: Please take inspiration from this readme.txt

walnutmarketing/WalnutMarketing.php 92% from 13 tests

The main PHP script in "Walnut.Marketing Portal" version 0.2.05 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("walnutmarketing.php" instead of "WalnutMarketing.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected2,715 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP63851211,695
XML400776
JavaScript83718243
CSS1071

PHP code Passed 2 tests

A brief analysis 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 complexity36.00
▷ Minimum class complexity10.00
▷ Maximum class complexity62.00
Average method complexity2.65
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods25
▷ Static methods936.00%
▷ Public methods2392.00%
▷ Protected methods00.00%
▷ Private methods28.00%
Functions66
▷ Named functions6192.42%
▷ Anonymous functions57.58%
Constants13
▷ Global constants13100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
5 PNG files occupy 0.05MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/Screenshot3.png15.19KB5.80KB▼ 61.85%
images/ActiveDEMAND-Transparent.png7.58KB3.97KB▼ 47.61%
includes/icons/favicon.png3.34KB2.27KB▼ 32.03%
images/favicon.png3.75KB2.94KB▼ 21.64%
images/Screenshot2.png21.57KB8.23KB▼ 61.84%