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.4
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1-5.9
  • WordPress version: 5.9.2
  • First release: Nov 19, 2020
  • Latest release: Mar 3, 2022
  • Number of updates: 14
  • Update frequency: every 33.5 days
  • Top authors: pagup (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active / 752 total downloads


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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲4.47MB] [CPU: ▼276.40ms] Passed 4 tests

Server-side resources used by Add Twitter Pixel for Twitter ads
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /8.42 ▲4.9173.46 ▲21.51
Dashboard /wp-admin8.44 ▲5.0358.02 ▲23.28
Posts /wp-admin/edit.php8.44 ▲4.8058.26 ▲20.74
Add New Post /wp-admin/post-new.php10.10 ▲3.14112.78 ▼1,167.65
Media Library /wp-admin/upload.php8.44 ▲5.1449.08 ▲19.80
Add Twitter Pixel /wp-admin/options-general.php?page=add-twitter-pixel8.4442.59
Freemius Debug [v.2.4.3] /wp-admin/admin.php?page=freemius8.4441.05

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 195 new files
Database: no new tables, 4 new options
New WordPress options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Add Twitter Pixel for Twitter ads
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,799 ▲7716.02 ▲0.045.50 ▼0.232.34 ▼0.11
Dashboard /wp-admin2,928 ▲676.13 ▲0.06114.29 ▼15.77169.92 ▲5.95
Posts /wp-admin/edit.php2,724 ▲333.25 ▲0.0062.68 ▼1.84154.11 ▲13.27
Add New Post /wp-admin/post-new.php1,685 ▲1322.39 ▲1.20399.27 ▼14.34157.27 ▼2.77
Media Library /wp-admin/upload.php1,731 ▲335.64 ▲0.12134.94 ▼13.57204.41 ▲6.65
Add Twitter Pixel /wp-admin/options-general.php?page=add-twitter-pixel1,3522.6558.44195.34
Freemius Debug [v.2.4.3] /wp-admin/admin.php?page=freemius1,4582.7353.32106.25

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/add-twitter-pixel/vendor/freemius/includes/class-freemius.php+8575
    Undefined property: stdClass::$plugins
  • This plugin does not fully uninstall, leaving 4 options in the database
    • fs_debug_mode
    • fs_accounts
    • fs_active_plugins
    • fs_gdpr

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
The following issues need your attention
  • 8× GET requests to PHP files have triggered server-side errors or warnings:
    • > 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: 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: Call to undefined function Pagup\\Twitter\\Controllers\\add_action() in wp-content/plugins/add-twitter-pixel/admin/controllers/TrackingController.php:10
    • > 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 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_url() in wp-content/plugins/add-twitter-pixel/admin/views/inc/top.view.php:5
    • > 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\\Controllers\\SettingsController' not found in wp-content/plugins/add-twitter-pixel/admin/Settings.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected


Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: Screenshot #2 (Twitter Pixel Settings Page) image required
You can look at the official readme.txt

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

The principal PHP file in "Add Twitter Pixel for Twitter ads" v. 1.0.4 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 143 characters long)
  • Domain Path: The domain path folder was not found ("/languages/")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin31,646 lines of code in 149 files:
LanguageFilesBlank linesComment linesLines of code

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
The following items need your attention
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 2,910)
Cyclomatic complexity
Average complexity per logical line of code0.63
Average class complexity71.59
▷ Minimum class complexity1.00
▷ Maximum class complexity2,910.00
Average method complexity4.55
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
▷ Abstract classes23.45%
▷ Concrete classes5696.55%
▷ Final classes00.00%
▷ Static methods19116.09%
▷ Public methods84471.10%
▷ Protected methods171.43%
▷ Private methods32627.46%
▷ Named functions9898.00%
▷ Anonymous functions22.00%
▷ Global constants10080.00%
▷ Class constants2520.00%
▷ Public constants25100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
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
vendor/freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
vendor/freemius/assets/img/add-twitter-pixel.png9.16KB5.26KB▼ 42.58%
vendor/freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
admin/assets/metabox.png106.13KB44.16KB▼ 58.39%