83% attrace

Code Review | Attrace

WordPress plugin Attrace scored83%from 54 tests.

About plugin

  • Plugin page: attrace
  • Plugin version: 2.0.21
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.5
  • WordPress version: 6.3.1
  • First release: Apr 8, 2020
  • Latest release: Dec 22, 2020
  • Number of updates: 78
  • Update frequency: every 3.3 days
  • Top authors: attrace (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,110 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲1.12MB] [CPU: ▲15.29ms] Passed 4 tests

This is a short check of server-side resources used by Attrace
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.76 ▲1.2561.99 ▲16.81
Dashboard /wp-admin4.46 ▲1.1174.80 ▲26.11
Posts /wp-admin/edit.php4.53 ▲1.1469.87 ▲15.75
Add New Post /wp-admin/post-new.php7.04 ▲1.11104.13 ▲8.60
Media Library /wp-admin/upload.php4.38 ▲1.1159.52 ▲19.98
Integrations /wp-admin/admin.php?page=attrace-integration-configs4.3553.96
Configuration /wp-admin/admin.php?page=attrace-config4.3656.84

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 726 new files
Database: 2 new tables, 7 new options
New tables
wp_attr_transaction
wp_attr_integration_config
New WordPress options
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_recent-posts
attr_tracking_db

Browser metrics Passed 4 tests

Attrace: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,817 ▲5614.25 ▼0.381.56 ▼0.0642.55 ▼5.29
Dashboard /wp-admin2,220 ▲435.67 ▲0.1087.39 ▼7.3285.70 ▲42.75
Posts /wp-admin/edit.php2,128 ▲281.98 ▲0.0036.61 ▼1.3736.68 ▲2.32
Add New Post /wp-admin/post-new.php1,573 ▲4518.04 ▼5.05648.80 ▼47.31152.26 ▲100.89
Media Library /wp-admin/upload.php1,431 ▲344.13 ▼0.1197.42 ▼4.1672.96 ▲28.43
Integrations /wp-admin/admin.php?page=attrace-integration-configs1,0402.1923.3930.10
Configuration /wp-admin/admin.php?page=attrace-config1,1052.1424.6038.97

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
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts

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
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 366× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Protobuf\\Internal\\Message' not found in wp-content/plugins/attrace/vendor/google/protobuf/src/Google/Protobuf/Internal/ExtensionRangeOptions.php:16
    • > PHP Fatal error
      Trait 'Google\\Protobuf\\Internal\\GetPublicDescriptorTrait' not found in wp-content/plugins/attrace/vendor/google/protobuf/src/Google/Protobuf/FieldDescriptor.php on line 38
    • > PHP Notice
      Constant SODIUM_CRYPTO_PWHASH_ALG_ARGON2I13 already defined in wp-content/plugins/attrace/vendor/paragonie/sodium_compat/lib/php72compat_const.php on line 55
    • > PHP Notice
      Constant SODIUM_CRYPTO_BOX_KEYPAIRBYTES already defined in wp-content/plugins/attrace/vendor/paragonie/sodium_compat/lib/php72compat_const.php on line 32
    • > PHP Fatal error
      Uncaught Error: Class 'ParagonIE_Sodium_Core_Salsa20' not found in wp-content/plugins/attrace/vendor/paragonie/sodium_compat/namespaced/Core/Salsa20.php:4
    • > PHP Notice
      Constant SODIUM_CRYPTO_AEAD_XCHACHA20POLY1305_IETF_ABYTES already defined in wp-content/plugins/attrace/vendor/paragonie/sodium_compat/lib/php72compat_const.php on line 26
    • > PHP Notice
      Constant SODIUM_LIBRARY_MAJOR_VERSION already defined in wp-content/plugins/attrace/vendor/paragonie/sodium_compat/lib/php72compat_const.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'ParagonIE_Sodium_Core_SipHash' not found in wp-content/plugins/attrace/vendor/paragonie/sodium_compat/namespaced/Core/SipHash.php:4
    • > PHP Notice
      Constant SODIUM_CRYPTO_AEAD_CHACHA20POLY1305_IETF_NSECBYTES already defined in wp-content/plugins/attrace/vendor/paragonie/sodium_compat/lib/php72compat_const.php on line 20
    • > PHP Fatal error
      Uncaught Error: Class 'ParagonIE_Sodium_Core_ChaCha20' not found in wp-content/plugins/attrace/vendor/paragonie/sodium_compat/src/Core/HChaCha20.php:10

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
3 plugin tags: blockchain, affiliate, tracking

attrace/attrace.php 85% from 13 tests

The main file in "Attrace" v. 2.0.21 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Requires PHP: Required version must be the same as the one declared in readme.txt ("7.2" instead of "7.0")
  • Description: The description should be shorter than 140 characters (currently 244 characters long)

Code Analysis 97% from 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 detected86,518 lines of code in 592 files:
LanguageFilesBlank linesComment linesLines of code
PHP44011,07638,26461,597
PO File1077,0627,27622,577
JSON1000845
Protocol Buffers4299695649
Markdown141700492
YAML560156
XML61343128
Bourne Shell419247
make19426
JavaScript1001

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Please fix the following
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 106)
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity16.79
▷ Minimum class complexity1.00
▷ Maximum class complexity633.00
Average method complexity2.85
▷ Minimum method complexity1.00
▷ Maximum method complexity106.00
Code structure
Namespaces51
Interfaces1
Traits2
Classes407
▷ Abstract classes276.63%
▷ Concrete classes38093.37%
▷ Final classes00.00%
Methods3,495
▷ Static methods77122.06%
▷ Public methods3,35595.99%
▷ Protected methods732.09%
▷ Private methods671.92%
Functions176
▷ Named functions16895.45%
▷ Anonymous functions84.55%
Constants737
▷ Global constants233.12%
▷ Class constants71496.88%
▷ Public constants714100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
5 PNG files occupy 0.47MB with 0.31MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
app/assets/img/integration-configuration.png225.99KB67.94KB▼ 69.94%
app/assets/img/operational_key.png195.58KB65.00KB▼ 66.76%
app/assets/img/menu-logo.png5.34KB0.89KB▼ 83.25%
app/assets/img/public-address.png39.22KB19.36KB▼ 50.63%
app/assets/img/menu-logo-large.png11.46KB4.31KB▼ 62.40%