74% newslettergate

Code Review | NewsletterGate - Gate Content for your Subscribers

WordPress plugin NewsletterGate - Gate Content for your Subscribers scored74%from 54 tests.

About plugin

  • Plugin page: newslettergate
  • Plugin version: 1.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.2.0
  • WordPress version: 6.3.1
  • First release: Jun 2, 2023
  • Latest release: Jun 3, 2023
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: ibenic (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /89 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.38MB] [CPU: ▼1.44ms] Passed 4 tests

This is a short check of server-side resources used by NewsletterGate - Gate Content for your Subscribers
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.85 ▲0.3947.38 ▲4.70
Dashboard /wp-admin3.73 ▲0.4256.33 ▼0.85
Posts /wp-admin/edit.php3.78 ▲0.4250.30 ▼0.99
Add New Post /wp-admin/post-new.php6.24 ▲0.3588.57 ▼8.62
Media Library /wp-admin/upload.php3.59 ▲0.3545.10 ▲12.75

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 35 new files
Database: 1 new table, 7 new options
New tables
wp_newslettergate_subscribers
New WordPress options
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
newslettergate_version
widget_recent-comments
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

NewsletterGate - Gate Content for your Subscribers: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲5414.08 ▼0.271.79 ▼0.0243.51 ▼1.63
Dashboard /wp-admin2,221 ▲475.61 ▼0.0691.34 ▲1.4545.09 ▲5.70
Posts /wp-admin/edit.php2,127 ▲272.00 ▲0.0034.39 ▼4.4735.50 ▲2.12
Add New Post /wp-admin/post-new.php1,539 ▲1123.53 ▲0.32709.90 ▲35.9648.89 ▼2.64
Media Library /wp-admin/upload.php1,430 ▲274.26 ▼0.05114.40 ▲11.3051.20 ▲7.30

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • Zombie tables were found after uninstall: 1 table
    • wp_newslettergate_subscribers
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • newslettergate_version

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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 items
  • 7× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'NewsletterGate\\Abstracts\\API' not found in wp-content/plugins/newslettergate/includes/integrations/class-convertkit.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'NewsletterGate\\Abstracts\\Settings' not found in wp-content/plugins/newslettergate/includes/class-admin.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'NewsletterGate\\Abstracts\\API' not found in wp-content/plugins/newslettergate/includes/integrations/class-mailchimp.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'NewsletterGate\\Abstracts\\Integration' not found in wp-content/plugins/newslettergate/includes/abstracts/class-api.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/newslettergate/templates/forms/default.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'NewsletterGate\\Abstracts\\API' not found in wp-content/plugins/newslettergate/includes/integrations/class-mailerlite.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/newslettergate/templates/forms/subscribe.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
5 plugin tags: lists, emails, marketing, newsletter, email

newslettergate/newslettergate.php Passed 13 tests

The main PHP file in "NewsletterGate - Gate Content for your Subscribers" ver. 1.2.1 adds more information about the plugin and also serves as the entry point for this plugin
69 characters long description:
Grow your email list by restricting content only to your subscribers.

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
Success! There were no dangerous files found in this plugin2,360 lines of code in 30 files:
LanguageFilesBlank linesComment linesLines of code
PHP194651,1051,767
JavaScript44194289
Sass2260151
CSS268147
SVG3006

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity13.14
▷ Minimum class complexity2.00
▷ Maximum class complexity28.00
Average method complexity2.30
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes14
▷ Abstract classes321.43%
▷ Concrete classes1178.57%
▷ Final classes00.00%
Methods131
▷ Static methods10.76%
▷ Public methods11487.02%
▷ Protected methods1612.21%
▷ Private methods10.76%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG images were found in this plugin