{"id":18930981,"url":"https://github.com/digitoimistodude/air-helper","last_synced_at":"2025-04-05T06:07:07.668Z","repository":{"id":41203199,"uuid":"91683806","full_name":"digitoimistodude/air-helper","owner":"digitoimistodude","description":"Air helper brings our preferences to Air-light based themes and extends with many ways like adding WooCommerce support.","archived":false,"fork":false,"pushed_at":"2025-03-27T13:25:49.000Z","size":786,"stargazers_count":52,"open_issues_count":9,"forks_count":6,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-30T15:39:40.061Z","etag":null,"topics":["woocommerce","wordpress","wordpress-plugin"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/digitoimistodude.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-05-18T11:08:11.000Z","updated_at":"2025-02-27T16:45:28.000Z","dependencies_parsed_at":"2024-01-12T15:47:23.988Z","dependency_job_id":"f9053da6-1f3c-4d27-9a9e-7ad96f5c7344","html_url":"https://github.com/digitoimistodude/air-helper","commit_stats":{"total_commits":456,"total_committers":10,"mean_commits":45.6,"dds":0.6008771929824561,"last_synced_commit":"d3dd8f5c3ba8e99c01c25d7a538ff86feaf5f41a"},"previous_names":[],"tags_count":113,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitoimistodude%2Fair-helper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitoimistodude%2Fair-helper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitoimistodude%2Fair-helper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitoimistodude%2Fair-helper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/digitoimistodude","download_url":"https://codeload.github.com/digitoimistodude/air-helper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247294536,"owners_count":20915340,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["woocommerce","wordpress","wordpress-plugin"],"created_at":"2024-11-08T11:40:01.094Z","updated_at":"2025-04-05T06:07:07.645Z","avatar_url":"https://github.com/digitoimistodude.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Air helper\n\n[![Packagist](https://img.shields.io/packagist/v/digitoimistodude/air-helper.svg?style=flat-square)](https://packagist.org/packages/digitoimistodude/air-helper) ![GitHub contributors](https://img.shields.io/github/contributors/digitoimistodude/air-helper.svg) [![Build Status for PHP 8.3](https://github.com/digitoimistodude/air-helper/actions/workflows/php8.3.yml/badge.svg)](https://github.com/digitoimistodude/air-helper/actions/workflows/php8.3.yml) [![Build Status for PHP](https://github.com/digitoimistodude/air-helper/actions/workflows/php.yml/badge.svg)](https://github.com/digitoimistodude/air-helper/actions/workflows/php.yml)\n\nAir helper provides helpful functions and modifications for WordPress projects. All modifications are preferences of [Dude](https://www.dude.fi). The plugin is meant to be used with our [Air light](https://github.com/digitoimistodude/air-light) theme, but works just fine also without it.\n\n## Table of contents\n\n+ [Features](#features)\n  - [Localization and Polylang support](#localization-and-polylang-support)\n    * [Registering your strings](#registering-your-strings)\n  - [Image lazyloading](#image-lazyloading)\n  - [Disabled views](#disabled-views)\n  - [Functions](#functions)\n    * [Archive related](#archive-related)\n    * [Checks](#checks)\n    * [Image lazyloading](#image-lazyloading-1)\n    * [Localization](#localization)\n    * [Pagination](#pagination)\n    * [Misc](#misc)\n  - [Modified WordPress functionality](#modified-wordpress-functionality)\n    * [Admin](#admin)\n    * [Security](#security)\n    * [ACF](#acf)\n    * [Archives](#archives)\n    * [The SEO Framework](#the-seo-framework)\n    * [Yoast](#yoast)\n    * [Commenting](#commenting)\n    * [Customizer](#customizer)\n    * [Gravity Forms](#gravity-forms)\n    * [Imagify](#imagify)\n    * [Email Address Encoder](#email-address-encoder)\n    * [Mail](#mail)\n    * [Media](#media)\n    * [Rest API](#rest-api)\n    * [TinyMCE](#tinymce)\n    * [Misc](#misc-1)\n+ [Installing](#installing)\n  - [Updates](#updates)\n+ [Changelog](#changelog)\n+ [Contributing](#contributing)\n\n## Please note before using\n\nAir helper and Air light are used for **development**, so those update very often. By using these code bases, you agree that the anything can change to a different direction without a prior warning.\n\n## Development workflow\n\n1. Git clone the repository to your local machine\n2. Create a fork\n3. Create a new branch for each new feature (Height task ID for Dude staff)\n4. Push your changes to your fork\n\n### Release cycle workflow\n\n1. Test changes thoroughly in multiple projects by symlinking the dev version of air-helper to the projects:\n\n  ```bash\n  # Project 1\n  rm -rf /var/www/project1/content/plugins/air-helper\n  ln -s /var/www/air-helper /var/www/project1/content/plugins/\n\n  # Project 2\n  rm -rf /var/www/project2/content/plugins/air-helper\n  ln -s /var/www/air-helper /var/www/project2/content/plugins/\n\n  # Project 3\n  rm -rf /var/www/project3/content/plugins/air-helper\n  ln -s /var/www/air-helper /var/www/project3/content/plugins/\n  ```\n\n2. Run `composer validate` to check if the composer.json is valid\n3. After verifying that the changes work as expected, send a pull request to the original repository\n4. Wait for review and merge\n\n#### For Dude staff\n\n5. Update versions in air-helper.php, package.json and CHANGELOG.md\n6. Create a release on GitHub with the same version number as the one in the `air-helper.php` file\n7. The release will automatically be published to Packagist\n\n## Features\n\n### Localization and Polylang support\n\nAir helper adds fallbacks for widely used Polylang functions, so you can use those events if there's no Polylang or multilanguage support needed in project at the time. This saves heck lot of a time when client want's multilanguage support later on.\n\nRefer to section below and [functions](#localization) to find out how to use translated strings.\n\n#### Registering your strings\n\nAll strings needs to be registered in one `localization.php` file and passed to `air_helper_pll_register_strings` an an array.\n\nLike this.\n```php\nadd_filter( 'air_helper_pll_register_strings', function() {\n  return [\n    // General\n    'General: Read more' =\u003e 'Read more',\n\n    // Footer\n    'Footer: Back to top' =\u003e 'Back to top',\n  ]\n} );\n```\n\n#### REST API support for string translations\n\nBy default, the string translation functions like `ask__()` does not work as intended when run inside a REST request, because Polylang does not support it. You can enable support by setting a `lang` parameter to your REST request and enabling the feature with hook:\n\n```php\nadd_filter( 'air_helper_pll_enable_rest', '__return_true' );\n```\n\n### Image lazyloading\n\nAir-helper supports [tuupola/lazyload](https://github.com/tuupola/lazyload) (legacy), [vanilla-lazyload](https://github.com/verlok/vanilla-lazyload) (legacy) and [native-lazyload](https://caniuse.com/?search=lazy) (native, current). [Air-light](https://github.com/digitoimistodude/air-light) version prior 6.1.8 (2020-10-20) had support for lazyload.js provided by [tuupola/lazyload](https://github.com/tuupola/lazyload) which is still legacy-supported by air-helper, but no longer provided by [air-light](https://github.com/digitoimistodude/air-light) theme.\n\nRefer to [functions](#image-lazyloading-1) to find out how to use image lazyloading.\n\n### Disabled views\n\nIn most of the client projects there's no need for some views that WordPress creates automatically. Instead of caring about those, show 404 page.\n\nCurrently disabled views are:\n- archives: tag, category, date, author\n- other: search\n\nEnable specific view back with filter `add_filter( 'air_helper_disable_views_{VIEW}', '__return_false' );` or all views with `remove_action( 'template_redirect', 'air_helper_disable_views' )`.\n\n### Functions\n\n#### Archive related\n* `get_posts_array( $args, $return_key )` Get posts in key=\u003etitle array.\n* `get_post_years()` Get years where there are posts published.\n* `get_post_months_by_year( $year, $post_type )` Get months where there are posts in a specific year. Defaults to current year.\n\n#### Checks\n* `post_exists_id( $post_id )` Check if post exists by ID.\n* `has_content( $post_id )` Check if post has main content. Defaults to current post id.\n* `has_children( $post_id, $post_type )` Check if post has child pages. Defaults to current post id.\n\n#### Image lazyloading\n* `vanilla_lazyload_div( $attachment_id, $fallback )` Echo image in lazyloading div.\n* `vanilla_lazyload_tag( $attachment_id, $fallback )` Echo image in lazyloading img tag.\n* `native_lazyload_tag( $attachment_id, $args )` Echo image in native lazyloading tag\n\nFallback is optional. By default fallback is default featured image from theme settings.\n\nArgs is optional. Its an array that contains \"fallback\", \"sizes\" and \"class\". Class can be set to give the image tag a specific class, if not set no class will be given.\n\nIf you want to get lazyloading div or tag as a string, you may prefix functions with `get_`.\n\n#### Localization\n* `ask__( $key, $lang )` Return string by key. Defaults to current language.\n* `ask_e( $key, $lang )` Echo string by key. Defaults to current language.\n* `asv__( $key, $lang )` Return string by value. Defaults to current language.\n* `asv_e( $key, $lang )` Echo string by value. Defaults to current language.\n\n#### Pagination\n* `get_next_page_id( $post_id )` Get ID of next page. Defaults to current page.\n* `get_prev_page_id( $post_id )` Get ID of previous page. Defaults to current page.\n\n#### Misc\n* `get_icons_for_user( $args)` Get list of icons which are available for user. Returns array of icons from defined theme directory (default `svg/foruser/`).\n* `wp_parse_args_dimensional( $a, $b )` Similar to wp_parse_args() just extended to work with multidimensional arrays.\n* `get_the_sentence_excerpt( $length, $excerpt )` Get excerpt with custom length of sentences. Defaults to three sentences and current post.\n* `get_primary_category( $post_id )` Get primary category for defined or current post.\n\n### Modified WordPress functionality\n\nAir helper modifies default behaviour of WordPress and various plugins to make it more suitable for customer projects, forcing our preferences and making sure that all the unnecessary information is hidden or unreachable.\n\nAll these modifications can be disabled or altered with hooks. All modifications live under `inc` directory.\n\nTo find out how the modification exactly works and how to disable it, search for a comment section from files in `inc` directory with following list item.\n\n#### Admin\n* Clean up admin menu from stuff we usually don't need.\n* Remove plugins page from admin menu, except for users with specific domain or override in user meta.\n* Hide ACF for all users, except for users with specific domain or override in user meta.\n* Clean up admin bar.\n* Add environment marker to admin bar.\n* Remove welcome panel.\n* Remove some boxes from dashboard.\n* Add our news and support widget to dashboard. Also, make sure that it is always first in order.\n* Remove some notices from dashboard.\n* Remove Update WP text from admin footer.\n* Hide all WP update nags.\n\n#### Security\n* Stop user enumeration by ?author=(init) urls.\n* Add honeypot to the login form. _NB! This does not replace proper security tools in server, consider using Fail2Ban or similar tool._\n* Change login failed message.\n* Remove hosting provider specific information from Site Health check.\n\n#### ACF\n* Hide ACF for all users, except the ones that have certain domain in their email address or user meta `_airhelper_admin_show_acf` with value of `true`\n* Try to activate the pro version automatically if `ACF_PRO_KEY` is defined in .env file\n\n#### Archives\n* Remove archive title prefix. Turn off by using `remove_filter( 'get_the_archive_title', 'air_helper_helper_remove_archive_title_prefix' )`\n\n#### The SEO Framework\n* Set default setting values.\n\n#### Yoast\n* Set Yoast SEO plugin metabox priority to low.\n\n#### Commenting\n* Add a pingback url auto-discovery header for singularly identifiable articles.\n\n#### Customizer\n* Remove custom CSS.\n\n#### Gravity Forms\n* Allow Gravity Forms to hide labels to add placeholders.\n\n#### Imagify\n* Disable admin bar menu.\n* Disable .webp conversion.\n* Get Imagify API key from .env\n* Resize large images and set maximum width.\n* Set optimization level to normal.\n\n#### Email Address Encoder\n* Hide always all email address encoder notifications.\n\n#### Mail\n* Force essential SendGrid settings.\n* Force to address in wp_mail function so that test emails won't go to client.\n* Show notice if SendGrid is not active or configured.\n\n#### Media\n* Custom uploads folder media/ instead of default content/uploads/.\n\n#### Rest API\n* Disable REST API users endpoint.\n\n#### TinyMCE\n* Show TinyMCE second editor tools row by default.\n* Remove some Tiny MCE formats from editor.\n\n#### Misc\n* Disable emojicons.\n* Strip unwanted html tags from titles.\n* Add support for correct UTF8 orderby for post_title and term name (äöå).\n* Add instant.page just-in-time preloading script to footer.\n\n## Installing\n\nDownload [the latest](https://github.com/digitoimistodude/air-helper/releases/latest) version as a zip package and unzip it to your plugins directory.\n\nOr install with composer, running command `composer require digitoimistodude/air-helper` in your project directory or add `\"digitoimistodude/air-helper\":\"dev-master\"` to your composer.json require.\n\n### Updates\n\nUpdates will be automatically distributed when a new version is released.\n\n## Changelog\n\nChangelog can be found from [releases page](https://github.com/digitoimistodude/air-helper/releases).\n\n## Contributing\n\nIf you have ideas about the plugin or spot an issue, please let us know. Before contributing ideas or reporting an issue about \"missing\" features or things regarding the nature of that matter, please read [Please note](#please-note-before-using) section. Thank you very much.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigitoimistodude%2Fair-helper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdigitoimistodude%2Fair-helper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigitoimistodude%2Fair-helper/lists"}