10% cp-simple-newsletter

Code Review | CP Simple Newsletter

WordPress plugin CP Simple Newsletter scored 10% from 54 tests.

About plugin

  • Plugin page: cp-simple-newsletter
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.8.3
  • WordPress version: 5.9.2
  • First release: May 17, 2016
  • Latest release: Nov 13, 2017
  • Number of updates: 14
  • Update frequency: every 38.9 days
  • Top authors: commercepundit (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active / 3,088 total downloads

Benchmarks

Plugin footprint 22% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
These installer errors require your attention
  • Install procedure had errors
    • > Notice in wp-content/plugins/cp-simple-newsletter/cp-simple-newsletter.php+94
    Undefined variable: newsletter_table_db_version

Server metrics [RAM: ▼2.12MB] [CPU: ▼334.90ms] Passed 4 tests

This is a short check of server-side resources used by CP Simple Newsletter
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.22 ▼1.2920.96 ▼34.97
Dashboard /wp-admin2.28 ▼1.1317.92 ▼16.57
Posts /wp-admin/edit.php2.28 ▼1.3616.33 ▼22.11
Add New Post /wp-admin/post-new.php2.28 ▼4.6918.13 ▼1,265.95
Media Library /wp-admin/upload.php2.28 ▼1.02113.97 ▲81.02
Freemius Debug [v.1.2.1] /wp-admin/admin.php?page=freemius2.2817.37
Subscribed Persons /wp-admin/admin.php?page=persons2.2819.29
Settings /wp-admin/admin.php?page=csn_init2.2818.38

Server storage [IO: ▲1.89MB] [DB: ▲0.01MB] 67% from 3 tests

Analyzing filesystem and database footprints of this plugin
Please try to fix the following items
  • Illegal file modification found: 1 file (0.60KB) outside of "wp-content/plugins/cp-simple-newsletter/" and "wp-content/uploads/"
    • (modified) .htaccess
Filesystem: 227 new files
Database: 1 new table, 4 new options
New tables
wp_cp_newsletter_table
New WordPress options
fs_api_cache
fs_accounts
fs_debug_mode
fs_active_plugins

Browser metrics Passed 4 tests

Checking browser requirements for CP Simple Newsletter
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,835 ▲8115.59 ▼0.035.87 ▲0.112.31 ▼0.52
Dashboard /wp-admin2,964 ▲1066.15 ▼0.03116.53 ▼20.26169.97 ▲8.30
Posts /wp-admin/edit.php2,760 ▲723.25 ▲0.0164.64 ▲1.27151.63 ▲9.64
Add New Post /wp-admin/post-new.php1,901 ▲19017.13 ▼4.20476.75 ▲2.82158.56 ▼2.61
Media Library /wp-admin/upload.php1,770 ▲695.44 ▼0.12140.32 ▼5.69205.62 ▲12.50
Freemius Debug [v.1.2.1] /wp-admin/admin.php?page=freemius1,3212.4452.41126.76
Subscribed Persons /wp-admin/admin.php?page=persons1,2992.3854.43104.31
Settings /wp-admin/admin.php?page=csn_init1,2202.4355.00136.66

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/cp-simple-newsletter/cp-simple-newsletter.php+94
    Undefined variable: newsletter_table_db_version
  • This plugin does not fully uninstall, leaving 1 table in the database
    • wp_cp_newsletter_table
  • The uninstall procedure has failed, leaving 4 options in the database
    • fs_active_plugins
    • fs_accounts
    • fs_debug_mode
    • fs_api_cache

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These errors were triggered by the plugin
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=csn_init
    • > Notice in wp-content/plugins/cp-simple-newsletter/cp-simple-newsletter.php+94
    Undefined variable: newsletter_table_db_version

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
The following issues need your attention
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function mysql_connect() in wp-content/plugins/cp-simple-newsletter/email-unsubscribe.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 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
1 plugin tags: newsletter

cp-simple-newsletter/cp-simple-newsletter.php Passed 13 tests

The main PHP file in "CP Simple Newsletter" ver. 1.1 adds more information about the plugin and also serves as the entry point for this plugin
65 characters long description:
Simple Newsletter form with sortcode to show anywhere on website.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected16,779 lines of code in 107 files:
LanguageFilesBlank linesComment linesLines of code
PHP723,1527,53513,118
PO File26506591,608
Sass15248801,558
JavaScript43763229
Markdown1590191
JSON20042
YAML22022
CSS90011

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.52
Average class complexity41.65
▷ Minimum class complexity1.00
▷ Maximum class complexity943.00
Average method complexity3.41
▷ Minimum method complexity1.00
▷ Maximum method complexity73.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes71
▷ Abstract classes45.63%
▷ Concrete classes6794.37%
▷ Final classes00.00%
Methods1,250
▷ Static methods17213.76%
▷ Public methods91673.28%
▷ Protected methods241.92%
▷ Private methods31024.80%
Functions118
▷ Named functions118100.00%
▷ Anonymous functions00.00%
Constants182
▷ Global constants14881.32%
▷ Class constants3418.68%
▷ Public constants34100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/wordpress-sdk-master/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%