89% cj-affiliate-network-integration

Code Review | CJ Affiliate Network Integration

WordPress plugin CJ Affiliate Network Integration scored89%from 54 tests.

About plugin

  • Plugin page: cj-affiliate-netw...
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.1-6.2.2
  • WordPress version: 6.3.1
  • First release: Sep 28, 2023
  • Latest release: Oct 3, 2023
  • Number of updates: 6
  • Update frequency: every 1.0 days
  • Top authors: cjintegration2023 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /44 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▼0.28MB] [CPU: ▼15.88ms] Passed 4 tests

An overview of server-side resources used by CJ Affiliate Network Integration
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.08 ▼1.396.05 ▼32.44
Dashboard /wp-admin3.41 ▲0.0748.77 ▼9.49
Posts /wp-admin/edit.php3.53 ▲0.1746.95 ▼3.57
Add New Post /wp-admin/post-new.php5.99 ▲0.1181.98 ▼18.02
Media Library /wp-admin/upload.php3.34 ▲0.1135.77 ▲3.71
CJ Affiliate Tracking /wp-admin/options-general.php?page=cj-affiliate-tracking-settings3.3031.81

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for CJ Affiliate Network Integration
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,824 ▲7813.28 ▼1.381.77 ▼0.0243.04 ▲5.39
Dashboard /wp-admin2,215 ▲275.80 ▲0.9093.94 ▼6.1840.17 ▼7.90
Posts /wp-admin/edit.php2,098 ▲92.02 ▲0.0036.18 ▼8.5932.45 ▼2.03
Add New Post /wp-admin/post-new.php1,539 ▲2522.44 ▲4.96681.44 ▲0.2547.04 ▼10.51
Media Library /wp-admin/upload.php1,403 ▲124.21 ▲0.01103.56 ▲5.7747.90 ▼0.45
CJ Affiliate Tracking /wp-admin/options-general.php?page=cj-affiliate-tracking-settings8592.1823.1226.63

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
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests Passed 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)
Good news, no errors were detected

SRP Passed 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
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 90% 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 require attention:
  • Tags: Too many tags (14 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can look at the official readme.txt

cj-affiliate-network-integration/cjapi_tracking.php 85% from 13 tests

"CJ Affiliate Network Integration" version 1.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("cj-affiliate-network-integration.php" instead of "cjapi_tracking.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected1,594 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP163362101,566
JavaScript1101027
CSS1001

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity9.43
▷ Minimum class complexity1.00
▷ Maximum class complexity39.00
Average method complexity2.24
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
Methods96
▷ Static methods22.08%
▷ Public methods8891.67%
▷ Protected methods00.00%
▷ Private methods88.33%
Functions40
▷ Named functions3177.50%
▷ Anonymous functions922.50%
Constants7
▷ Global constants571.43%
▷ Class constants228.57%
▷ Public constants2100.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
There are no PNG files in this plugin