84% flattr

Code Review | Flattr

WordPress plugin Flattr scored 84% from 53 tests.

About plugin

  • Plugin page: flattr
  • Plugin version: 1.2.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-4.1.1
  • WordPress version: 5.8.1
  • First release: Apr 12, 2010
  • Latest release: Aug 22, 2016
  • Number of updates: 129
  • Update frequency: every 18.0 days
  • Top authors: aphex3k (41.86%)VoxPelli (33.33%)flattr (21.71%)cschwarz (4.65%)leihog (1.55%)

Code review

53 tests

User reviews

7 reviews

Install metrics

500+ active / 79,373 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.24MB] [CPU: ▼387.43ms] Passed 4 tests

Analyzing server-side resources used by Flattr
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.03 ▲0.3133.54 ▲11.58
Dashboard /wp-admin3.28 ▲0.2345.90 ▲2.77
Posts /wp-admin/edit.php3.39 ▲0.2942.20 ▼1.03
Add New Post /wp-admin/post-new.php5.65 ▲0.22100.40 ▼1,557.24
Media Library /wp-admin/upload.php3.22 ▲0.2246.27 ▲5.79

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 58 new files
Database: no new tables, 19 new options
New WordPress options
flattr_top
flattrss_relpayment_enabled
flattr_global_button
flattrss_custom_image_url
user_based_flattr_buttons
flattr_lng
flattr_popout_enabled
flattr_button_style
flattrss_button_enabled
flattr_compact
...

Browser metrics Passed 4 tests

A check of browser resources used by Flattr
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,707 ▲10116.08 ▲0.228.10 ▼3.0349.19 ▲6.10
Dashboard /wp-admin2,970 ▲1147.05 ▲1.24138.49 ▼30.01131.02 ▲16.01
Posts /wp-admin/edit.php2,774 ▲682.71 ▲0.0396.08 ▲29.87133.29 ▲41.92
Add New Post /wp-admin/post-new.php1,919 ▲44022.09 ▲3.91318.95 ▼66.46144.22 ▲36.94
Media Library /wp-admin/upload.php1,763 ▼95.51 ▲0.53143.81 ▼32.86127.14 ▲6.13

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
The following items require your attention
  • This plugin did not uninstall successfully, leaving 19 options in the database
    • user_based_flattr_buttons_since_time
    • flattr_relpayment_enabled
    • flattrss_relpayment_enabled
    • flattrss_button_enabled
    • flattr_aut
    • user_based_flattr_buttons
    • flattr_popout_enabled
    • flattrss_custom_image_url
    • flattrss_relpayment_escaping_disabled
    • flattr_global_button
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
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
  • 8× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Notice
      Undefined variable: btnDisabled in wp-content/plugins/flattr/postmeta-template.php on line 1
    • > PHP Fatal error
      Uncaught Error: Class 'Flattr' not found in wp-content/plugins/flattr/settings-templates/header.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/flattr/settings-templates/plugin.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/flattr/postmeta-template.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Flattr' not found in wp-content/plugins/flattr/settings-templates/footer.php:7
    • > PHP Warning
      Use of undefined constant WP_UNINSTALL_PLUGIN - assumed 'WP_UNINSTALL_PLUGIN' (this will throw an Error in a future version of PHP) in wp-content/plugins/flattr/uninstall.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/flattr/flattr.php:793
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_bloginfo() in wp-content/plugins/flattr/settings-templates/user.php:1

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration Passed 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
3 plugin tags: donate, flattr, micropayments

flattr/flattr.php Passed 13 tests

The primary PHP file in "Flattr" version 1.2.2 is used by WordPress to initiate all plugin functionality
55 characters long description:
Give your readers the opportunity to Flattr your effort

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected2,410 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP143291731,840
CSS23870328
JavaScript1250242

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity28.00
▷ Minimum class complexity3.00
▷ Maximum class complexity106.00
Average method complexity3.75
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods59
▷ Static methods711.86%
▷ Public methods4881.36%
▷ Protected methods1118.64%
▷ Private methods00.00%
Functions14
▷ Named functions14100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants350.00%
▷ Class constants350.00%
▷ Public constants3100.00%

Plugin size Passed 1 test

Image compression Passed 1 test

All PNG images should be compressed to minimize bandwidth usage for end users
37 compressed PNG files occupy 0.21MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/ui-bg_highlight-soft_100_eeeeee_1x100.png0.09KB0.14KB0.00%
img/flattr-badge-white_full_size.png131.56KB51.20KB▼ 61.08%
jquery-ui/images/ui-icons_ef8c08_256x240.png4.27KB4.11KB▼ 3.78%
img/flattr-badge-large.png1.60KB1.56KB▼ 2.38%
jquery-ui/images/ui-bg_glass_65_ffffff_1x400.png0.10KB0.10KB▼ 5.71%