10% transact

Code Review | Transact

WordPress plugin Transact scored 10% from 54 tests.

About plugin

  • Plugin page: transact
  • Plugin version: 5.9.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.0.1
  • WordPress version: 6.3.1
  • First release: Jan 18, 2017
  • Latest release: Jul 20, 2022
  • Number of updates: 180
  • Update frequency: every 11.1 days
  • Top authors: transact (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 3,792 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Please fix the following installer errors
  • Install procedure had errors
    • > Notice in wp-content/plugins/transact/admin/controllers/transact-admin-settings-menu.php+787
    Trying to access array offset on value of type bool

Server metrics [RAM: ▼1.09MB] [CPU: ▼44.74ms] Passed 4 tests

A check of server-side resources used by Transact
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.90 ▼0.569.74 ▼29.67
Dashboard /wp-admin2.92 ▼0.3912.24 ▼43.60
Posts /wp-admin/edit.php2.92 ▼0.4413.63 ▼30.45
Add New Post /wp-admin/post-new.php2.92 ▼2.9711.38 ▼75.23
Media Library /wp-admin/upload.php2.92 ▼0.3112.93 ▼19.85

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 66 new files
Database: 2 new tables, 6 new options
New tables
wp_transact_transactions
wp_transact_subscription_transactions
New WordPress options
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Transact
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,824 ▲8914.41 ▲0.021.58 ▼0.2040.52 ▼8.55
Dashboard /wp-admin2,226 ▲385.90 ▲0.05106.67 ▼7.6744.63 ▲0.16
Posts /wp-admin/edit.php2,113 ▲212.00 ▼0.0042.27 ▲4.4436.67 ▼0.07
Add New Post /wp-admin/post-new.php1,688 ▲32320.82 ▲3.03641.02 ▼72.2873.84 ▲35.85
Media Library /wp-admin/upload.php1,411 ▲264.19 ▲0.01107.91 ▲10.0448.76 ▼1.30

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 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 did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/transact/admin/controllers/transact-admin-settings-menu.php+787
    Trying to access array offset on value of type bool
  • Zombie tables detected upon uninstall: 2 tables
    • wp_transact_subscription_transactions
    • wp_transact_transactions
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/transact/vendors/transact-io-php/demo/demo-api.php
    • > /wp-content/plugins/transact/frontend/controllers/comments_slot.php
  • 16× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Transact\\FrontEnd\\Controllers\\AccountMeta\\plugin_dir_path() in wp-content/plugins/transact/frontend/controllers/account_meta.php:7
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/upgrade.php' (include_path='.:/usr/share/php') in wp-content/plugins/transact/activation.php on line 13
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/transact/activation.php on line 5
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/transact/activation.php on line 13
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/upgrade.php): failed to open stream: No such file or directory in wp-content/plugins/transact/activation.php on line 13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Transact\\Admin\\Settings\\Post\\plugin_dir_path() in wp-content/plugins/transact/admin/controllers/transact-admin-settings-post.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/transact/transact-plugin.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Transact\\FrontEnd\\Controllers\\Post\\plugin_dir_path() in wp-content/plugins/transact/frontend/controllers/transact-single-post.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Transact\\FrontEnd\\Controllers\\Buttons\\plugin_dir_path() in wp-content/plugins/transact/frontend/controllers/transact-handle-buttons.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Transact\\Admin\\Settings\\Shortcode\\plugin_dir_path() in wp-content/plugins/transact/admin/controllers/transact-shortcode.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed:
  • Tags: You are using too many tags: 13 tag instead of maximum 10
You can take inspiration from this readme.txt

transact/transact-plugin.php 92% from 13 tests

The main PHP script in "Transact" version 5.9.0 is automatically included on every request by WordPress
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("transact.php" instead of "transact-plugin.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 detected5,398 lines of code in 50 files:
LanguageFilesBlank linesComment linesLines of code
PHP358941,3044,085
JavaScript27279456
CSS31014244
Markdown3590224
HTML1452200
JSON400102
XML10077
INI12110

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity19.73
▷ Minimum class complexity1.00
▷ Maximum class complexity99.00
Average method complexity3.47
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces18
Interfaces0
Traits0
Classes26
▷ Abstract classes00.00%
▷ Concrete classes26100.00%
▷ Final classes00.00%
Methods200
▷ Static methods189.00%
▷ Public methods18492.00%
▷ Protected methods94.50%
▷ Private methods73.50%
Functions32
▷ Named functions618.75%
▷ Anonymous functions2681.25%
Constants52
▷ Global constants815.38%
▷ Class constants4484.62%
▷ Public constants44100.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
5 PNG files occupy 0.29MB with 0.21MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.png103.59KB43.35KB▼ 58.15%
frontend/assets/transact_icon.png15.09KB0.74KB▼ 95.09%
transact_icon.png15.09KB0.74KB▼ 95.09%
assets/screenshot-2.png33.00KB13.71KB▼ 58.47%
assets/screenshot-3.png131.46KB60.29KB▼ 54.13%