Comments (9)
No need to extend the sniff, this can simply be changed from the ruleset <type>warning</type>
.
from wpthemereview.
??
usage would influence the minimum PHP version for the theme, wouldn't it?
from wpthemereview.
Once core moves to PHP 7.0 (beginning of the next year) this shouldn't have to be an issue imo.
from wpthemereview.
Once core moves to PHP 7.0
But this is for themes, not core. And themes can run on different versions of core, with different versions of PHP.
from wpthemereview.
Both ?:
(PHP 5.3+) usage, as well as ??
(PHP 7.0+) usage influence the minimum PHP version for a theme.
If I remember correctly, the "default" presumption is that themes support the current WP version + up to three versions back. That would currently mean WP 5.0
- 5.3
, meaning the "normal" minimum PHP version for a theme would still need to be PHP 5.2
, though this can be changed of course with the Requires PHP:
header.
from wpthemereview.
Yes, but considering that WP doesn't check the Requires PHP
header for themes yet, the theme still needs to make sure that it doesn't fatal. And a warning to the reviewer would be good to have.
from wpthemereview.
Well, the PHPCompatibilityWP
ruleset which is included in TRTCS already does so as the minimum PHP version for that is set to 5.2
.
from wpthemereview.
The decision from the triage: include this sniff but change it so that it throws a warning instead of an error.
This shouldn't be too hard, just extend the sniff and override the process_token
method
from wpthemereview.
Even better 🙂
from wpthemereview.
Related Issues (20)
- variables in template files are flagged as global HOT 15
- Exceptions to prefixing hook names HOT 7
- False positive on loading stylesheet in JS file HOT 4
- [New sniff] WC template versions HOT 7
- Dealing with rules that shouldn't apply to templates HOT 1
- Add sniff: WordPress.PHP.IniSet HOT 6
- [New sniff] Check if page templates are using reserved prefix HOT 1
- Detect WPTRT feature project versions HOT 3
- Add sniff documentation HOT 1
- Minimal PHP version HOT 11
- Whitelist wp_body_open function from PrefixAllGlobals sniff HOT 5
- sniff: plugin territory - action hook wp_edit_nav_menu_walker
- File name with reserved slug in subfolder HOT 11
- Optimisation and minor grammar fixes
- Internal.Exception -- function update_current_version() should be removed.
- [Update existing sniff] Allow register_block_style HOT 1
- Allow `add_menu_page` & `add_submenu_page` HOT 9
- twentyseventeen theme: posts with no date - but date is shown in similar posts HOT 1
- 👍
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wpthemereview.