73% add-twitter-pixel

Code Review | Add Twitter Pixel for Twitter ads

WordPress plugin Add Twitter Pixel for Twitter ads scored 73% from 54 tests.

About plugin

  • Plugin page: add-twitter-pixel
  • Plugin version: 1.0.6
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1-6.3
  • WordPress version: 6.3.1
  • First release: Nov 19, 2020
  • Latest release: Aug 24, 2023
  • Number of updates: 21
  • Update frequency: every 48.0 days
  • Top authors: pagup (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active / 2,044 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲5.04MB] [CPU: ▲24.92ms] 75% from 4 tests

This is a short check of server-side resources used by Add Twitter Pixel for Twitter ads
The following require your attention
  • Extra RAM: Extra memory usage should kept under 5MB (currently 5.04MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /8.93 ▲5.4870.09 ▲29.88
Dashboard /wp-admin8.95 ▲5.6570.37 ▲23.93
Posts /wp-admin/edit.php8.96 ▲5.6078.90 ▲31.72
Add New Post /wp-admin/post-new.php9.33 ▲3.45114.48 ▲14.61
Media Library /wp-admin/upload.php8.95 ▲5.7365.86 ▲31.26
Add Twitter Pixel /wp-admin/options-general.php?page=add-twitter-pixel8.9661.99
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius8.9558.67

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 211 new files
Database: no new tables, 9 new options
New WordPress options
fs_active_plugins
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
fs_debug_mode
widget_recent-comments
db_upgraded
widget_recent-posts
fs_accounts

Browser metrics Passed 4 tests

Add Twitter Pixel for Twitter ads: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,822 ▲8713.25 ▼1.011.70 ▼0.1432.49 ▼15.99
Dashboard /wp-admin2,228 ▲395.78 ▲0.84112.89 ▼5.0844.98 ▲0.66
Posts /wp-admin/edit.php2,111 ▲252.06 ▲0.0536.88 ▼2.6137.39 ▲2.20
Add New Post /wp-admin/post-new.php1,522 ▼1017.51 ▼5.63659.50 ▲54.4658.78 ▲3.85
Media Library /wp-admin/upload.php1,410 ▲254.27 ▲0.0695.51 ▼4.8244.19 ▲0.16
Add Twitter Pixel /wp-admin/options-general.php?page=add-twitter-pixel1,0221.8827.1295.97
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,0851.7223.2226.72

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/add-twitter-pixel/vendor/freemius/includes/class-freemius.php+8486
    Undefined property: stdClass::$plugins
  • This plugin did not uninstall successfully, leaving 9 options in the database
    • fs_accounts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • fs_debug_mode
    • widget_recent-comments
    • fs_active_plugins
    • can_compress_scripts

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 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 8× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_kses() in wp-content/plugins/add-twitter-pixel/admin/views/notices/support.view.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/add-twitter-pixel/admin/views/metabox.view.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Pagup\\Twitter\\Core\\Plugin' not found in wp-content/plugins/add-twitter-pixel/admin/views/settings.view.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Pagup\\Twitter\\Core\\Plugin' not found in wp-content/plugins/add-twitter-pixel/admin/views/faq.view.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/add-twitter-pixel/admin/views/inc/top.view.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Pagup\\Twitter\\Controllers\\SettingsController' not found in wp-content/plugins/add-twitter-pixel/admin/Settings.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/add-twitter-pixel/admin/views/inc/side.view.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Pagup\\Twitter\\Controllers\\add_action() in wp-content/plugins/add-twitter-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 errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Please fix the following attributes:
  • Screenshots: Screenshot #2 (Twitter Pixel Settings Page) image missing
The official readme.txt is a good inspiration

add-twitter-pixel/add-twitter-pixel.php 85% from 13 tests

The main file in "Add Twitter Pixel for Twitter ads" v. 1.0.6 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Domain Path: The domain path points to a folder that does not exist ("/languages/")
  • Description: Please don't use more than 140 characters for the plugin description (currently 143 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected34,781 lines of code in 163 files:
LanguageFilesBlank linesComment linesLines of code
PHP1428,23017,47934,389
JavaScript43759202
CSS151518181
JSON2009

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
It is recommended to fix the following
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 3,073)
Cyclomatic complexity
Average complexity per logical line of code0.63
Average class complexity74.72
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity4.50
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces4
Interfaces0
Traits0
Classes61
▷ Abstract classes23.28%
▷ Concrete classes5996.72%
▷ Final classes00.00%
Methods1,314
▷ Static methods21516.36%
▷ Public methods92270.17%
▷ Protected methods191.45%
▷ Private methods37328.39%
Functions105
▷ Named functions10398.10%
▷ Anonymous functions21.90%
Constants147
▷ Global constants10068.03%
▷ Class constants4731.97%
▷ Public constants47100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
4 PNG files occupy 0.13MB with 0.06MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/assets/metabox.png106.13KB44.16KB▼ 58.39%
vendor/freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
vendor/freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
vendor/freemius/assets/img/add-twitter-pixel.png9.16KB5.26KB▼ 42.58%