66% newsletter-artisan

Code Review | Newsletter Artisan

WordPress plugin Newsletter Artisan scored66%from 54 tests.

About plugin

  • Plugin page: newsletter-artisan
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-4.2.2
  • WordPress version: 6.3.1
  • First release: Jan 13, 2015
  • Latest release: May 20, 2015
  • Number of updates: 35
  • Update frequency: every 3.8 days
  • Top authors: DamianS1987 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /2,412 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.15MB] [CPU: ▼2.44ms] Passed 4 tests

An overview of server-side resources used by Newsletter Artisan
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.65 ▲0.1943.39 ▲0.23
Dashboard /wp-admin3.48 ▲0.1851.19 ▲1.29
Posts /wp-admin/edit.php3.53 ▲0.1848.63 ▲1.63
Add New Post /wp-admin/post-new.php6.00 ▲0.1291.69 ▼12.89
Media Library /wp-admin/upload.php3.34 ▲0.1138.50 ▲6.37
Theme change /wp-admin/admin.php?page=theme_adestra_pick3.3138.17
Artisan /wp-admin/admin.php?page=adestra_newsletter_id3.3132.83

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 182 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
newsletter_artisan
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

Newsletter Artisan: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲8313.23 ▼1.401.86 ▲0.1944.24 ▲3.68
Dashboard /wp-admin2,224 ▲395.02 ▼0.7896.94 ▼1.2581.44 ▲37.86
Posts /wp-admin/edit.php2,110 ▲212.02 ▼0.0338.03 ▲0.9832.37 ▼1.60
Add New Post /wp-admin/post-new.php1,539 ▲323.11 ▼0.20697.61 ▲88.4851.91 ▼6.58
Media Library /wp-admin/upload.php1,403 ▲154.22 ▲0.0597.19 ▲0.0573.60 ▲28.69
Theme change /wp-admin/admin.php?page=theme_adestra_pick1,3552.8459.11115.61
Artisan /wp-admin/admin.php?page=adestra_newsletter_id1,5183.4165.7556.83

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These server-side errors were triggered
    • > GET request to /wp-admin/admin.php?page=theme_adestra_pick
    • > POST request to /wp-admin/admin-ajax.php
    • > Error in wp-content/plugins/newsletter-artisan/app/util/util.php+43
    Uncaught ErrorException: This theme does not exist - client validation error in wp-content/plugins/newsletter-artisan/app/util/util.php:43
    Stack trace:
    #0 wp-content/plugins/newsletter-artisan/app/util/util.php(57): throwServerError()
    #1 wp-content/plugins/newsletter-artisan/app/themes_management/ThemesManagement.php(16): app_error()
    #2 wp-content/plugins/newsletter-artisan/app/network/theme_network/ThemeNetwork.php(41): ThemesManagement->getThemes()
    #3 wp-content/plugins/newsletter-artisan/app/util/util.php(96): ThemesNetwork->route()
    #4 wp-content/plugins/newsletter-artisan/app/network/theme_network/ThemeNetwork.php(116): handleAction()
    #5 wp-includes/class-wp-hook.php(310): respThemesNetwork()
    #6 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #7 wp-includes/plugin.php(517): WP_Hook->do_action()
    #8 wp-admin
    • > GET request to /wp-admin/admin.php?page=adestra_newsletter_id
    • > POST request to /wp-admin/admin-ajax.php
    • > Notice in wp-content/plugins/newsletter-artisan/app/html_nodes_management/HtmlNodesManagement.php+46
    Undefined index: HTMLCollection

SRP 0% 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
Please fix the following
  • 4× PHP files output text when accessed directly:
    • > /wp-content/plugins/newsletter-artisan/app/templates/theme_changer.php
    • > /wp-content/plugins/newsletter-artisan/app/templates/admin_post.php
    • > /wp-content/plugins/newsletter-artisan/admin/template/theme_changer.php
    • > /wp-content/plugins/newsletter-artisan/admin/template/admin_post.php
  • 40× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/newsletter-artisan/admin/theme_change_admin.php:22
    • > PHP Fatal error
      Uncaught Error: Interface 'Mustache_Exception' not found in wp-content/plugins/newsletter-artisan/lib/Mustache/Exception/SyntaxException.php:15
    • > PHP Fatal error
      Uncaught Error: Interface 'Mustache_Loader' not found in wp-content/plugins/newsletter-artisan/lib/Mustache/Loader/InlineLoader.php:51
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/newsletter-artisan/newsletter_artisan.php:73
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_types() in wp-content/plugins/newsletter-artisan/admin/newsletter_admin.php:32
    • > PHP Fatal error
      Uncaught Error: Interface 'Mustache_Loader' not found in wp-content/plugins/newsletter-artisan/lib/Mustache/Loader/StringLoader.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/newsletter-artisan/app/unit_tests/network/nodes_network/nodesNetworkTest.php:3
    • > PHP Fatal error
      Uncaught Error: Interface 'Mustache_Loader' not found in wp-content/plugins/newsletter-artisan/lib/Mustache/Loader/FilesystemLoader.php:27
    • > PHP Fatal error
      Uncaught Error: Interface 'Mustache_Loader' not found in wp-content/plugins/newsletter-artisan/lib/Mustache/Loader/CascadingLoader.php:16
    • > PHP Fatal error
      require_once(): Failed opening required 'wp-content/plugins/newsletter-artisan/app/posts_selection_management/old/../util/util.php' (include_path='.:/usr/share/php') in wp-content/plugins/newsletter-artisan/app/posts_selection_management/old/PostsSelectionManagement.php on line 4

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please take a look at the following user-side issues
    • > GET request to /wp-admin/admin.php?page=theme_adestra_pick
    • > Network (severe)
    wp-admin/admin-ajax.php - Failed to load resource: the server responded with a status of 500 (Internal Server Error)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=adestra_newsletter_id
    • > Network (severe)
    http://dstefaniak-staging.com/random_images/na/na_new.jpg - Failed to load resource: net::ERR_NAME_NOT_RESOLVED

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Please fix the following attributes:
  • Screenshots: Screenshot #2 (This is the second screen shot) image missing
Please take inspiration from this readme.txt

newsletter-artisan/newsletter_artisan.php 85% from 13 tests

"Newsletter Artisan" version 1.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("newsletter-artisan.php" instead of "newsletter_artisan.php")
  • Git Repository: An alternative Git repository was detected

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected26,190 lines of code in 161 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript461,6821,43110,630
CSS27881135,369
Sass20640273,967
PHP658381,8653,031
HTML19105151,273
Mustache17401,117
SVG100565
JSON510211
Markdown111016
XML10011

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity5.82
▷ Minimum class complexity1.00
▷ Maximum class complexity46.00
Average method complexity2.17
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces0
Interfaces6
Traits0
Classes49
▷ Abstract classes36.12%
▷ Concrete classes4693.88%
▷ Final classes00.00%
Methods244
▷ Static methods72.87%
▷ Public methods18676.23%
▷ Protected methods135.33%
▷ Private methods4518.44%
Functions25
▷ Named functions25100.00%
▷ Anonymous functions00.00%
Constants53
▷ Global constants11.89%
▷ Class constants5298.11%
▷ Public constants52100.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
2 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/img/newsletter_icon.png3.06KB0.63KB▼ 79.48%
admin/res/newsletter_icon.png3.06KB0.63KB▼ 79.48%