84% constant-contact-api

Code Review | Constant Contact for WordPress

WordPress plugin Constant Contact for WordPress scored84%from 54 tests.

About plugin

  • Plugin page: constant-contact-api
  • Plugin version: 4.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-4.6.1
  • WordPress version: 6.3.1
  • First release: Feb 15, 2010
  • Latest release: Sep 13, 2016
  • Number of updates: 221
  • Update frequency: every 10.9 days
  • Top authors: katzwebdesign (78.28%)jamesbenson (22.17%)

Code review

54 tests

User reviews

63 reviews

Install metrics

2,000+ active /194,711 total downloads

Benchmarks

Plugin footprint 83% 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: ▲2.00MB] [CPU: ▲12.10ms] Passed 4 tests

A check of server-side resources used by Constant Contact for WordPress
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /5.41 ▲1.9562.73 ▲18.55
Dashboard /wp-admin5.33 ▲1.9967.64 ▲3.84
Posts /wp-admin/edit.php5.38 ▲2.0270.56 ▲20.41
Add New Post /wp-admin/post-new.php7.93 ▲2.05105.04 ▲5.61
Media Library /wp-admin/upload.php5.25 ▲2.0368.26 ▲31.29
Tags /wp-admin/edit-tags.php?taxonomy=wp_log_type&post_type=wp_log5.2661.71
Activity Log /wp-admin/admin.php?page=constant-contact-log5.2357.94
Logs /wp-admin/edit.php?post_type=wp_log5.3057.14
Constant Contact /wp-admin/admin.php?page=constant-contact-api5.1959.36
Add New /wp-admin/post-new.php?post_type=wp_log5.3883.37

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 560 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

Constant Contact for WordPress: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,065 ▲31913.67 ▼0.468.31 ▲6.3240.48 ▼1.59
Dashboard /wp-admin2,371 ▲1835.83 ▲0.96113.48 ▼0.4077.73 ▲32.77
Posts /wp-admin/edit.php2,278 ▲1892.17 ▲0.1839.28 ▼3.2735.19 ▲0.44
Add New Post /wp-admin/post-new.php1,694 ▲16622.58 ▲4.30699.32 ▲57.3957.79 ▼4.60
Media Library /wp-admin/upload.php1,574 ▲1864.20 ▼0.00115.42 ▲10.4392.89 ▲45.51
Tags /wp-admin/edit-tags.php?taxonomy=wp_log_type&post_type=wp_log1,7662.3331.0039.46
Activity Log /wp-admin/admin.php?page=constant-contact-log1,0092.0826.0330.26
Logs /wp-admin/edit.php?post_type=wp_log1,2431.9736.3331.51
Constant Contact /wp-admin/admin.php?page=constant-contact-api1,0492.0539.4849.26
Add New /wp-admin/post-new.php?post_type=wp_log2,3997.67169.29122.71

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • 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)
The smoke test was a success, however most plugin functionality was not tested

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 fix the following items
  • 172× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Cookie\\CookieJar' not found in wp-content/plugins/constant-contact-api/vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/constant-contact-api/vendor/guzzlehttp/psr7/src/NoSeekStream.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/constant-contact-api/vendor/guzzlehttp/psr7/src/MultipartStream.php:10
    • > PHP Warning
      Use of undefined constant CTCT_FILE_URL - assumed 'CTCT_FILE_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/constant-contact-api/lib/eventspot/views/promo.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/constant-contact-api/classes/class.ctct_global.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'CTCT_Admin_Page' not found in wp-content/plugins/constant-contact-api/lib/form-designer/form-designer.php:10
    • > PHP Notice
      Undefined variable: cc_form_selected_id in wp-content/plugins/constant-contact-api/lib/form-designer/views/form-designer.php on line 12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/constant-contact-api/lib/eventspot/views/view.event-view.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Ctct\\Components\\EmailMarketing\\Campaign' not found in wp-content/plugins/constant-contact-api/classes/class.kwscampaign.php:17
    • > PHP Notice
      Undefined variable: Event in wp-content/plugins/constant-contact-api/lib/eventspot/views/view.event-view.php on line 6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% 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
These attributes need your attention:
  • Screenshots: Add images for these screenshots: #1 (The administration screen is the landing page for all the functionality of the plugin.), #2 (Form Designer - custom form designer built right into the plugin), #3 (View campaign details on the Campaigns screen), #4 (Edit Contacts inside the plugin), #5 (Update list names), #6 (Embed Events inline and view EventSpot event details)
You can take inspiration from this readme.txt

constant-contact-api/constant-contact-api.php Passed 13 tests

Analyzing the main PHP file in "Constant Contact for WordPress" version 4.1.1
66 characters long description:
Powerfully integrate Constant Contact into your WordPress website.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin31,452 lines of code in 330 files:
LanguageFilesBlank linesComment linesLines of code
PHP2244,7499,35018,810
JavaScript328341,0974,233
Markdown1291003,138
CSS1672701,372
PO File15826761,337
LESS22190381,126
JSON900575
HTML6500460
SVG100284
YAML417069
make211031
XML10017

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity13.66
▷ Minimum class complexity1.00
▷ Maximum class complexity174.00
Average method complexity3.09
▷ Minimum method complexity1.00
▷ Maximum method complexity66.00
Code structure
Namespaces23
Interfaces14
Traits2
Classes162
▷ Abstract classes31.85%
▷ Concrete classes15998.15%
▷ Final classes85.03%
Methods1,136
▷ Static methods16214.26%
▷ Public methods94282.92%
▷ Protected methods685.99%
▷ Private methods12611.09%
Functions226
▷ Named functions13961.50%
▷ Anonymous functions8738.50%
Constants53
▷ Global constants1324.53%
▷ Class constants4075.47%
▷ Public constants40100.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
29 PNG files occupy 0.22MB with 0.06MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
lib/eventspot/images/calendar_add.png0.71KB0.76KB0.00%
js/alertify.js/example/assets/img/dialogs.png48.58KB17.03KB▼ 64.95%
images/admin/btn_see_how_blue.png9.74KB9.08KB▼ 6.79%
lib/form-designer/css/images/ui-icons_cd0a0a_256x240.png4.27KB4.11KB▼ 3.78%
images/admin/logo-horizontal.png23.67KB7.96KB▼ 66.37%