78% cjaffiliate-export

Code Review | CJ Affiliate Export plugin

WordPress plugin CJ Affiliate Export plugin scored78%from 54 tests.

About plugin

  • Plugin page: cjaffiliate-export
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-4.7
  • WordPress version: 6.3.1
  • First release: Jun 1, 2017
  • Latest release: Jun 1, 2017
  • Number of updates: 9
  • Update frequency: every 0.2 days
  • Top authors: cimpleo (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,229 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.12MB] [CPU: ▲0.34ms] Passed 4 tests

An overview of server-side resources used by CJ Affiliate Export plugin
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1238.31 ▲1.28
Dashboard /wp-admin3.42 ▲0.1150.72 ▼2.37
Posts /wp-admin/edit.php3.53 ▲0.1850.98 ▲3.13
Add New Post /wp-admin/post-new.php6.02 ▲0.1399.38 ▼0.68
Media Library /wp-admin/upload.php3.34 ▲0.1138.17 ▲4.78
CJ export /wp-admin/tools.php?page=cjexport3.3230.78

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: 9 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-comments
db_upgraded
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
CJAffiliate_plugin_export
widget_theysaidso_widget
CJAffiliate_plugin_exportTransfer

Browser metrics Passed 4 tests

Checking browser requirements for CJ Affiliate Export plugin
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,810 ▲4914.41 ▼0.101.60 ▲0.0741.37 ▼3.12
Dashboard /wp-admin2,216 ▲365.68 ▲0.0193.00 ▲0.0641.25 ▼9.12
Posts /wp-admin/edit.php2,124 ▲242.18 ▲0.1736.99 ▲0.8635.99 ▼2.77
Add New Post /wp-admin/post-new.php1,535 ▲922.95 ▼0.50622.17 ▼67.2159.30 ▲8.96
Media Library /wp-admin/upload.php1,415 ▲154.26 ▲0.0396.98 ▼17.3041.56 ▼5.37
CJ export /wp-admin/tools.php?page=cjexport1,1161.7429.9337.82

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_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Smoke test failed, please fix the following
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/tools.php?page=cjexport
    • > Notice in wp-content/plugins/cjaffiliate-export/include/page-export.php+37
    Undefined index: cron_schedules
    • > GET request to /wp-admin/tools.php?page=cjexport
    • > Notice in wp-content/plugins/cjaffiliate-export/include/page-export.php+43
    Undefined index: cron_schedules_time

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_admin_page_title() in wp-content/plugins/cjaffiliate-export/include/page-export.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cjaffiliate-export/include/class_productExport.php:28
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cjaffiliate-export/include/Cj_SettingFields.php:4

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 96% from 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
8 plugin tags: ftp, cj affiliate, file, cron, xml...

cjaffiliate-export/CJ-AffiliateExport.php 92% from 13 tests

The primary PHP file in "CJ Affiliate Export plugin" version 1.0 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("cjaffiliate-export.php" instead of "CJ-AffiliateExport.php")

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
Good job! No executable or dangerous file extensions detected784 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP4133184603
CSS1240127
JavaScript281554

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity45.00
▷ Minimum class complexity4.00
▷ Maximum class complexity86.00
Average method complexity4.52
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes150.00%
Methods25
▷ Static methods28.00%
▷ Public methods1976.00%
▷ Protected methods00.00%
▷ Private methods624.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.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
1 PNG file occupies 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/screenshots/1.png32.76KB14.15KB▼ 56.82%