62% latmmo-aff-amazon

Code Review | LATMMO Aff Amazon

WordPress plugin LATMMO Aff Amazon scored62%from 54 tests.

About plugin

  • Plugin page: latmmo-aff-amazon
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.8
  • WordPress version: 6.3.1
  • First release: Nov 19, 2021
  • Latest release: Nov 20, 2021
  • Number of updates: 31
  • Update frequency: every 0.1 days
  • Top authors: seobeginner (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /407 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲2.44MB] [CPU: ▲12.74ms] Passed 4 tests

This is a short check of server-side resources used by LATMMO Aff Amazon
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /5.98 ▲2.4766.75 ▲20.24
Dashboard /wp-admin5.83 ▲2.4472.99 ▲5.33
Posts /wp-admin/edit.php5.88 ▲2.4776.03 ▲24.34
Add New Post /wp-admin/post-new.php8.37 ▲2.44108.66 ▲1.05
Media Library /wp-admin/upload.php5.68 ▲2.4165.20 ▲28.33
Table Compare /wp-admin/edit.php?post_type=latmmo-table-compare5.8664.15
Amazon Product /wp-admin/edit.php?post_type=latmmo-product5.8665.74

Server storage [IO: ▲29.09MB] [DB: ▲0.00MB] 67% from 3 tests

Analyzing filesystem and database footprints of this plugin
These are issues you should consider
  • The filesystem usage should be lower than 25MB (currently using 29.09MB)
Filesystem: 3,023 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
db_upgraded
can_compress_scripts
_latmmo_amazon_options
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for LATMMO Aff Amazon
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,990 ▲20413.50 ▼0.858.90 ▲7.1042.97 ▼0.77
Dashboard /wp-admin2,295 ▲1155.67 ▼0.0092.87 ▼17.9737.45 ▼18.65
Posts /wp-admin/edit.php2,206 ▲1032.04 ▲0.0042.69 ▲1.0637.45 ▲4.74
Add New Post /wp-admin/post-new.php6,570 ▲5,04428.96 ▲5.96998.23 ▲344.8841.63 ▼19.30
Media Library /wp-admin/upload.php1,503 ▲1004.29 ▲0.14100.47 ▼1.3945.34 ▼2.62
Cronjob /wp-admin/admin.php?page=latmmo-settings#tab=cronjob1,8225.6087.0849.46
Addons /wp-admin/admin.php?page=latmmo-settings#tab=addons1,8235.3975.0934.15
Table Compare /wp-admin/edit.php?post_type=latmmo-table-compare1,6055.3767.0630.70
General /wp-admin/admin.php?page=latmmo-settings#tab=general1,8395.3878.1635.02
Amazon Product /wp-admin/edit.php?post_type=latmmo-product1,6085.6264.3729.03
Table Compare /wp-admin/admin.php?page=latmmo-settings#tab=table-compare1,8524.8267.0635.38

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • _latmmo_amazon_options

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Please fix the following server-side errors
  • 25 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=latmmo-product
    • > Warning in wp-content/plugins/easy-age-verifier/lib/extras/wpApi.php+48
    file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known
  • 25 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=latmmo-product
    • > Warning in wp-content/plugins/easy-age-verifier/lib/extras/wpApi.php+48
    file_get_contents(http://www.fillyourtaproom.com/wp-json/wp/v2/posts?per_page=10): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known

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
  • 5× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/latmmo-aff-amazon/libs/paapi5-php-sdk/SampleGetItemsApi.php
    • > /wp-content/plugins/latmmo-aff-amazon/libs/paapi5-php-sdk/SampleGetVariationsApi.php
    • > /wp-content/plugins/latmmo-aff-amazon/libs/paapi5-php-sdk/SampleSearchItemsApi.php
    • > /wp-content/plugins/latmmo-aff-amazon/libs/paapi5-php-sdk/vendor/squizlabs/php_codesniffer/scripts/build-phar.php
    • > /wp-content/plugins/latmmo-aff-amazon/libs/paapi5-php-sdk/SampleGetBrowseNodesApi.php
  • 1461× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_Constraint' not found in wp-content/plugins/latmmo-aff-amazon/libs/paapi5-php-sdk/vendor/phpunit/phpunit/src/Framework/Constraint/Callback.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Console\\Application' not found in wp-content/plugins/latmmo-aff-amazon/libs/paapi5-php-sdk/vendor/friendsofphp/php-cs-fixer/src/Console/Application.php:36
    • > PHP Fatal error
      Uncaught Error: Class 'PhpCsFixer\\Tokenizer\\AbstractTransformer' not found in wp-content/plugins/latmmo-aff-amazon/libs/paapi5-php-sdk/vendor/friendsofphp/php-cs-fixer/src/Tokenizer/Transformer/ImportTransformer.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Console\\Descriptor\\Descriptor' not found in wp-content/plugins/latmmo-aff-amazon/libs/paapi5-php-sdk/vendor/symfony/console/Descriptor/MarkdownDescriptor.php:29
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/latmmo-aff-amazon/libs/paapi5-php-sdk/vendor/guzzlehttp/psr7/src/CachingStream.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Finder\\Tests\\Iterator\\RealIteratorTestCase' not found in wp-content/plugins/latmmo-aff-amazon/libs/paapi5-php-sdk/vendor/symfony/finder/Tests/FinderTest.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Prophecy\\Exception\\Prophecy\\MethodProphecyException' not found in wp-content/plugins/latmmo-aff-amazon/libs/paapi5-php-sdk/vendor/phpspec/prophecy/src/Prophecy/Exception/Prediction/NoCallsException.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'PhpCsFixer\\AbstractFixer' not found in wp-content/plugins/latmmo-aff-amazon/libs/paapi5-php-sdk/vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/ProtectedToPrivateFixer.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Console\\Output\\Output' not found in wp-content/plugins/latmmo-aff-amazon/libs/paapi5-php-sdk/vendor/symfony/console/Output/StreamOutput.php:31
    • > PHP Fatal error
      Uncaught Error: Interface 'PHP_CodeSniffer_Sniff' not found in wp-content/plugins/latmmo-aff-amazon/libs/paapi5-php-sdk/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Objects/ObjectMemberCommaSniff.php:28

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
2 plugin tags: amazon, amazon affiliate

latmmo-aff-amazon/main.php 85% from 13 tests

"LATMMO Aff Amazon" version 1.0.0'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 168 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("latmmo-aff-amazon.php" instead of "main.php")

Code Analysis 3% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
It is important to fix the following items
  • Even if your plugin relies on executable files (for example a companion app), never distribute executable files with your plugin
    • .exe - Executable in Windows
      • wp-content/plugins/latmmo-aff-amazon/libs/paapi5-php-sdk/vendor/symfony/console/Resources/bin/hiddeninput.exe
    • .bat - Batch File in Windows
      • wp-content/plugins/latmmo-aff-amazon/libs/paapi5-php-sdk/vendor/squizlabs/php_codesniffer/scripts/phpcbf.bat
      • wp-content/plugins/latmmo-aff-amazon/libs/paapi5-php-sdk/vendor/squizlabs/php_codesniffer/scripts/phpcs.bat
299,305 lines of code in 2,750 files:
LanguageFilesBlank linesComment linesLines of code
PHP2,24046,39597,320198,410
SVG90052,712
Markdown1053,195010,478
PO File203,0373,4146,180
XML1882341365,552
Sass251,06935,492
JSON70905,339
CSS143744904,854
JavaScript181,3174034,273
YAML39171893,462
reStructuredText58874371,301
XSD42931466
Ant4690426
C1528223
m41111141
C/C++ Header112840
Bourne Shell21021
DOS Batch222216
Dockerfile18010
make1409

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
Please fix the following
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 270)
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity10.98
▷ Minimum class complexity1.00
▷ Maximum class complexity542.00
Average method complexity2.85
▷ Minimum method complexity1.00
▷ Maximum method complexity270.00
Code structure
Namespaces202
Interfaces155
Traits13
Classes2,091
▷ Abstract classes733.49%
▷ Concrete classes2,01896.51%
▷ Final classes44321.95%
Methods12,411
▷ Static methods1,26310.18%
▷ Public methods10,16781.92%
▷ Protected methods1,0008.06%
▷ Private methods1,24410.02%
Functions1,003
▷ Named functions38438.29%
▷ Anonymous functions61961.71%
Constants828
▷ Global constants13316.06%
▷ Class constants69583.94%
▷ Public constants695100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/placeholder.png24.75KB10.16KB▼ 58.94%
libs/codestar-framework/assets/images/checkerboard.png2.29KB2.54KB0.00%