84% postaffiliatepro

Code Review | Post Affiliate Pro

WordPress plugin Post Affiliate Pro scored84%from 54 tests.

About plugin

  • Plugin page: postaffiliatepro
  • Plugin version: 1.26.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-6.3
  • WordPress version: 6.3.1
  • First release: Nov 22, 2010
  • Latest release: Oct 25, 2023
  • Number of updates: 326
  • Update frequency: every 14.5 days
  • Top authors: jurajsim (100%)

Code review

54 tests

User reviews

19 reviews

Install metrics

1,000+ active /70,120 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲2.36MB] [CPU: ▲6.74ms] Passed 4 tests

Server-side resources used by Post Affiliate Pro
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /5.79 ▲2.3346.41 ▲9.91
Dashboard /wp-admin5.69 ▲2.3458.54 ▼2.97
Posts /wp-admin/edit.php5.80 ▲2.4471.09 ▲19.86
Add New Post /wp-admin/post-new.php8.29 ▲2.40106.81 ▲3.01
Media Library /wp-admin/upload.php5.61 ▲2.3850.32 ▲17.00
General /wp-admin/admin.php?page=pap-top-level-options-handle5.5847.14
Debugging /wp-admin/admin.php?page=pap-debugging-page5.5845.73

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 87 new files
Database: no new tables, 10 new options
New WordPress options
pap-url
widget_theysaidso_widget
theysaidso_admin_options
postaffiliatepro_db_version
woocomm-orderid
widget_recent-comments
db_upgraded
widget_recent-posts
can_compress_scripts
widget_postaffiliatepro_topaffiliates

Browser metrics Passed 4 tests

An overview of browser requirements for Post Affiliate Pro
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,817 ▲7114.28 ▲0.061.56 ▼0.0739.72 ▼5.56
Dashboard /wp-admin2,223 ▲525.55 ▼0.1182.97 ▼5.3979.17 ▲38.80
Posts /wp-admin/edit.php2,131 ▲282.00 ▲0.0437.92 ▼0.5235.04 ▼2.55
Add New Post /wp-admin/post-new.php1,559 ▲3118.61 ▼4.54647.61 ▼45.1458.89 ▲4.19
Media Library /wp-admin/upload.php1,419 ▲194.14 ▼0.1196.48 ▲4.0474.03 ▲29.95
General /wp-admin/admin.php?page=pap-top-level-options-handle9302.1823.1127.12
Debugging /wp-admin/admin.php?page=pap-debugging-page8562.0023.7627.96

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% 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
  • Zombie WordPress options were found after uninstall: 10 options
    • postaffiliatepro_db_version
    • widget_theysaidso_widget
    • db_upgraded
    • woocomm-orderid
    • pap-url
    • widget_recent-posts
    • widget_recent-comments
    • widget_postaffiliatepro_topaffiliates
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% 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
Almost there! Just fix the following items
  • 35× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'postaffiliatepro_Form_Base' not found in wp-content/plugins/postaffiliatepro/Form/Settings/EDD.class.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'postaffiliatepro_Base' not found in wp-content/plugins/postaffiliatepro/Shortcode/Affiliate.class.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'postaffiliatepro_Base' not found in wp-content/plugins/postaffiliatepro/Util/TopAffiliatesHelper.class.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/postaffiliatepro/Widget/TopAffiliates.class.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'postaffiliatepro_Form_Base' not found in wp-content/plugins/postaffiliatepro/Form/Settings/SimplePayPro.class.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'postaffiliatepro_Form_Base' not found in wp-content/plugins/postaffiliatepro/Form/Settings/General.class.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'postaffiliatepro_Form_Base' not found in wp-content/plugins/postaffiliatepro/Form/Settings/AdditionalOptions.class.php:11
    • > PHP Warning
      include(): Failed opening 'WP_PLUGIN_DIR/postaffiliatepro/Base.class.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/postaffiliatepro/postaffiliatepro.php on line 17
    • > PHP Fatal error
      Uncaught Error: Class 'postaffiliatepro_Form_Base' not found in wp-content/plugins/postaffiliatepro/Form/Settings/Campaigns.class.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'postaffiliatepro_Base' not found in wp-content/plugins/postaffiliatepro/postaffiliatepro.php:20

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Please fix the following attributes:
  • Screenshots: Add images for these screenshots: #1 (Plugin adds an extra menu to your WP installation), #2 (General options screen), #3 (Signup options screen), #4 (Click tracking options screen), #5 (Top affiliates widget config), #6 (You can also use shortcodes)
Please take inspiration from this readme.txt

postaffiliatepro/postaffiliatepro.php Passed 13 tests

The primary PHP file in "Post Affiliate Pro" version 1.26.5 is used by WordPress to initiate all plugin functionality
65 characters long description:
Easily integrate your WordPress site with your Post Affiliate Pro

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin9,749 lines of code in 36 files:
LanguageFilesBlank linesComment linesLines of code
PHP351,9071,3509,729
CSS13220

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity13.85
▷ Minimum class complexity1.00
▷ Maximum class complexity218.00
Average method complexity2.24
▷ Minimum method complexity1.00
▷ Maximum method complexity71.00
Code structure
Namespaces0
Interfaces6
Traits0
Classes95
▷ Abstract classes22.11%
▷ Concrete classes9397.89%
▷ Final classes00.00%
Methods1,120
▷ Static methods696.16%
▷ Public methods84675.54%
▷ Protected methods12511.16%
▷ Private methods14913.30%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants271
▷ Global constants31.11%
▷ Class constants26898.89%
▷ Public constants268100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
24 PNG files occupy 0.75MB with 0.40MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
resources/img/cf7.png36.23KB14.17KB▼ 60.87%
screenshot-3.png26.81KB8.77KB▼ 67.28%
resources/img/spp.png6.50KB2.57KB▼ 60.48%
resources/img/stripepay.png5.78KB3.94KB▼ 31.73%
resources/img/pmpro.png9.33KB4.61KB▼ 50.58%