56% adfoxly

Code Review | AdFoxly - Ad Manager, AdSense Ads & Ads.txt

WordPress plugin AdFoxly - Ad Manager, AdSense Ads & Ads.txt scored56%from 54 tests.

About plugin

  • Plugin page: adfoxly
  • Plugin version: 1.8.5
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.0.3
  • WordPress version: 6.3.1
  • First release: Apr 22, 2019
  • Latest release: Jul 26, 2023
  • Number of updates: 81
  • Update frequency: every 19.3 days
  • Top authors: rafalosinski (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

1,000+ active /24,117 total downloads

Benchmarks

Plugin footprint 47% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲5.88MB] [CPU: ▲35.17ms] 75% from 4 tests

Analyzing server-side resources used by AdFoxly - Ad Manager, AdSense Ads & Ads.txt
It is recommended to improve the following
  • Extra RAM: Extra memory usage should kept under 5MB (currently 5.88MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /9.30 ▲5.8496.02 ▲56.49
Dashboard /wp-admin9.24 ▲5.9483.62 ▲34.69
Posts /wp-admin/edit.php9.24 ▲5.8993.30 ▲44.31
Add New Post /wp-admin/post-new.php11.73 ▲5.85118.76 ▲16.77
Media Library /wp-admin/upload.php9.24 ▲6.0277.79 ▲44.91
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius9.2884.94

Server storage [IO: ▲31.58MB] [DB: ▲0.01MB] 67% from 3 tests

Analyzing filesystem and database footprints of this plugin
Please try to fix the following items
  • Total filesystem usage must be limited to 25MB (currently using 31.58MB)
Filesystem: 2,310 new files
Database: 2 new tables, 11 new options
New tables
wp_adfoxly_statistics_clicks
wp_adfoxly_statistics_views
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
db_upgraded
widget_adfoxly
widget_recent-posts
fs_debug_mode
can_compress_scripts
fs_active_plugins
adfoxly_settings
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for AdFoxly - Ad Manager, AdSense Ads & Ads.txt
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,959 ▲22413.63 ▼0.748.90 ▲7.1033.30 ▼9.62
Dashboard /wp-admin2,232 ▲445.83 ▲0.9393.32 ▼15.3789.18 ▲48.48
Posts /wp-admin/edit.php2,130 ▲411.98 ▼0.0537.05 ▼5.3636.38 ▼0.62
Add New Post /wp-admin/post-new.php1,555 ▲1318.21 ▲0.17712.03 ▲97.9352.47 ▲1.93
Media Library /wp-admin/upload.php1,420 ▲324.23 ▲0.0096.74 ▲0.6776.63 ▲31.67
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,1071.7425.4326.90

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/adfoxly/includes/freemius/includes/class-freemius.php+8486
    Undefined property: stdClass::$plugins
  • This plugin does not fully uninstall, leaving 2 tables in the database
    • wp_adfoxly_statistics_views
    • wp_adfoxly_statistics_clicks
  • Zombie WordPress options were found after uninstall: 11 options
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • fs_accounts
    • db_upgraded
    • fs_debug_mode
    • fs_active_plugins
    • widget_theysaidso_widget
    • widget_adfoxly
    • adfoxly_settings
    • ...

Smoke tests 50% 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 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/adfoxly/vendor/mobiledetect/mobiledetectlib/export/exportToJSON.php
    • > /wp-content/plugins/adfoxly/includes/mobiledetect/export/exportToJSON.php
  • 572× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Http\\Discovery\\ClassDiscovery' not found in wp-content/plugins/adfoxly/vendor/php-http/discovery/src/MessageFactoryDiscovery.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/adfoxly/vendor/composer/installers/src/Composer/Installers/YawikInstaller.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/adfoxly/vendor/composer/installers/src/Composer/Installers/CroogoInstaller.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Http\\Discovery\\Exception\otFoundException' not found in wp-content/plugins/adfoxly/vendor/php-http/discovery/src/NotFoundException.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'Twig\\CacheExtension\\CacheStrategy\\KeyGeneratorInterface' not found in wp-content/plugins/adfoxly/vendor/timber/timber/lib/Cache/KeyGenerator.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\BodySummarizerInterface' not found in wp-content/plugins/adfoxly/vendor/guzzlehttp/guzzle/src/BodySummarizer.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'Sentry\\ClientInterface' not found in wp-content/plugins/adfoxly/vendor/sentry/sentry/src/Client.php:23
    • > PHP Fatal error
      Uncaught Error: Interface 'Twig\\Sandbox\\SecurityPolicyInterface' not found in wp-content/plugins/adfoxly/vendor/twig/twig/src/Sandbox/SecurityPolicy.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'Twig\odeVisitor\\AbstractNodeVisitor' not found in wp-content/plugins/adfoxly/vendor/twig/twig/src/Profiler/NodeVisitor/ProfilerNodeVisitor.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'Http\\Client\\Common\\HttpClientPool\\HttpClientPool' not found in wp-content/plugins/adfoxly/vendor/php-http/client-common/src/HttpClientPool/RoundRobinClientPool.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need your attention:
  • Screenshots: Please describe screenshot #6 in adfoxly/assets to your readme.txt
The official readme.txt is a good inspiration

adfoxly/adfoxly.php 92% from 13 tests

"AdFoxly - Ad Manager, AdSense Ads & Ads.txt" version 1.8.5's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 174 characters long)

Code Analysis 95% 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
No dangerous file extensions were detected317,930 lines of code in 2,171 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript72136,73057,072168,601
PHP1,22923,83950,72699,641
CSS1644,3161,90743,517
JSON5003,122
Twig13411071,052
SVG19014770
Markdown62010513
Bourne Shell66222315
LESS21710195
PO File15969145
XML10020
YAML21016
make16013
reStructuredText18510

PHP code 0% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
It is recommended to fix the following
  • Cyclomatic complexity of classes should be reduced to less than 1000 (currently 3,073)
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 166)
Cyclomatic complexity
Average complexity per logical line of code0.52
Average class complexity12.70
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity3.29
▷ Minimum method complexity1.00
▷ Maximum method complexity166.00
Code structure
Namespaces122
Interfaces110
Traits26
Classes999
▷ Abstract classes262.60%
▷ Concrete classes97397.40%
▷ Final classes28228.98%
Methods5,860
▷ Static methods87814.98%
▷ Public methods4,77681.50%
▷ Protected methods3065.22%
▷ Private methods77813.28%
Functions639
▷ Named functions33352.11%
▷ Anonymous functions30647.89%
Constants401
▷ Global constants11628.93%
▷ Class constants28571.07%
▷ Public constants25388.77%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
29 PNG files occupy 0.52MB with 0.17MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/vendors/stisla/dist/assets/modules/jquery-ui/images/ui-icons_777777_256x240.png6.83KB4.17KB▼ 38.92%
assets/vendors/stisla/dist/assets/modules/owlcarousel2/dist/assets/owl.video.play.png4.86KB2.74KB▼ 43.61%
assets/vendors/stisla/dist/assets/modules/jquery-ui/images/ui-icons_444444_256x240.png6.83KB4.17KB▼ 38.86%
assets/vendors/stisla/dist/assets/modules/jquery-ui/images/ui-icons_cc0000_256x240.png4.44KB4.17KB▼ 6.02%
includes/freemius/assets/img/adfoxly.png40.88KB25.05KB▼ 38.72%