73% add-tiktok-advertising-pixel

Code Review | Add Tiktok Pixel for Tiktok ads (+Woocommerce)

WordPress plugin Add Tiktok Pixel for Tiktok ads (+Woocommerce) scored 73% from 54 tests.

About plugin

  • Plugin page: add-tiktok-advert...
  • Plugin version: 1.2.4
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1-5.9
  • WordPress version: 5.9.2
  • First release: Nov 26, 2019
  • Latest release: Mar 27, 2022
  • Number of updates: 35
  • Update frequency: every 24.3 days
  • Top authors: pagup (94.29%)The-Rock (8.57%)

Code review

54 tests

User reviews

10 reviews

Install metrics

2,000+ active / 14,598 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲4.48MB] [CPU: ▼275.62ms] Passed 4 tests

This is a short check of server-side resources used by Add Tiktok Pixel for Tiktok ads (+Woocommerce)
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /8.43 ▲4.9278.49 ▲28.30
Dashboard /wp-admin8.45 ▲5.0455.68 ▲20.83
Posts /wp-admin/edit.php8.45 ▲4.8156.99 ▲19.60
Add New Post /wp-admin/post-new.php10.13 ▲3.15116.68 ▼1,162.16
Media Library /wp-admin/upload.php8.45 ▲5.1543.62 ▲19.25
Freemius Debug [v.2.4.3] /wp-admin/admin.php?page=freemius8.4542.77

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 198 new files
Database: no new tables, 4 new options
New WordPress options
fs_gdpr
fs_active_plugins
fs_accounts
fs_debug_mode

Browser metrics Passed 4 tests

A check of browser resources used by Add Tiktok Pixel for Tiktok ads (+Woocommerce)
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,846 ▲12515.78 ▲0.126.27 ▼0.131.91 ▼0.40
Dashboard /wp-admin2,953 ▲956.06 ▼0.02119.83 ▼16.78162.47 ▲1.54
Posts /wp-admin/edit.php2,749 ▲553.25 ▼0.0064.46 ▼1.00149.00 ▲5.00
Add New Post /wp-admin/post-new.php1,666 ▼8619.66 ▼2.27436.63 ▼20.89147.97 ▼13.93
Media Library /wp-admin/upload.php1,760 ▲625.65 ▲0.12135.15 ▼12.03200.05 ▲15.38
Freemius Debug [v.2.4.3] /wp-admin/admin.php?page=freemius1,4492.5455.64123.01

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/add-tiktok-advertising-pixel/vendor/freemius/includes/class-freemius.php+8575
    Undefined property: stdClass::$plugins
  • This plugin did not uninstall successfully, leaving 4 options in the database
    • fs_accounts
    • fs_gdpr
    • fs_debug_mode
    • fs_active_plugins

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

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
  • 11× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Pagup\\TiktokPixel\\Controllers\\SettingsController' not found in wp-content/plugins/add-tiktok-advertising-pixel/admin/Settings.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/add-tiktok-advertising-pixel/admin/views/inc/top.view.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/add-tiktok-advertising-pixel/admin/views/metabox.view.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/add-tiktok-advertising-pixel/admin/views/inc/promotions.view.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/add-tiktok-advertising-pixel/admin/views/inc/side.view.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/add-tiktok-advertising-pixel/admin/views/inc/top.view.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/add-tiktok-advertising-pixel/admin/views/inc/top.view.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/add-tiktok-advertising-pixel/admin/views/inc/top.view.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/add-tiktok-advertising-pixel/admin/views/inc/top.view.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Pagup\\TiktokPixel\\Controllers\\add_action() in wp-content/plugins/add-tiktok-advertising-pixel/admin/controllers/TrackingController.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
5 plugin tags: conversion, pixel, tiktok, retargeting, tiktok pixel

add-tiktok-advertising-pixel/tiktok-advertising-pixel.php 77% from 13 tests

The main PHP file in "Add Tiktok Pixel for Tiktok ads (+Woocommerce)" ver. 1.2.4 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("add-tiktok-advertising-pixel.php" instead of "tiktok-advertising-pixel.php")
  • Domain Path: The domain path points to a folder that does not exist ("/languages/")
  • Description: The description should be shorter than 140 characters (currently 179 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected32,166 lines of code in 151 files:
LanguageFilesBlank linesComment linesLines of code
PHP1337,65916,27831,684
CSS131716268
JavaScript43759206
JSON1008

PHP code 50% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Please fix the following
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 2,910)
Cyclomatic complexity
Average complexity per logical line of code0.63
Average class complexity71.81
▷ Minimum class complexity1.00
▷ Maximum class complexity2,910.00
Average method complexity4.55
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces4
Interfaces0
Traits0
Classes58
▷ Abstract classes23.45%
▷ Concrete classes5696.55%
▷ Final classes00.00%
Methods1,191
▷ Static methods19416.29%
▷ Public methods84871.20%
▷ Protected methods171.43%
▷ Private methods32627.37%
Functions100
▷ Named functions9898.00%
▷ Anonymous functions22.00%
Constants126
▷ Global constants10180.16%
▷ Class constants2519.84%
▷ Public constants25100.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
4 PNG files occupy 0.13MB with 0.07MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
vendor/freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
vendor/freemius/assets/img/add-twitter-pixel.png9.16KB5.26KB▼ 42.58%
admin/assets/metabox.png101.86KB28.34KB▼ 72.17%