Giter VIP home page Giter VIP logo

Comments (5)

faberglas avatar faberglas commented on July 3, 2024

I have the latest version of WP on my own domain. My theme is Salient 7.0.1 from themeforest.net

I got three warnings on my Salient dashboard:
Redux Framework Warning
select2-css CDN unavailable. Some controls may not render properly. Please wait a few minutes, then try refreshing the page. Unable to load some remotely hosted scripts..
Redux Framework Warning
select2-js CDN unavailable. Some controls may not render properly. Please wait a few minutes, then try refreshing the page. Unable to load some remotely hosted scripts..
Redux Framework Warning
ace-editor-js CDN unavailable. Some controls may not render properly. Please wait a few minutes, then try refreshing the page. Unable to load some remotely hosted scripts.

I got this fatal eror message on my WP dashboard:
Plugin could not be activated because it triggered a fatal error.
Parse error: syntax error, unexpected '.', expecting ',' or ';' in /home/fabergla/public_html/markcorbettwilson.com/wp/wp-content/plugins/creativecommons-wordpress-plugin-2.1-beta/includes/class-creativecommons-button.php on line 9

from wp-plugin-creativecommons.

TheCrowned avatar TheCrowned commented on July 3, 2024

@simonemontrucchio This is likely to be due to the fact that you are running an outdated PHP version (< 5.4). The problem lies in the compact syntax for defining an array:

foreach (['license_url', 'attribution_url', 'source_work_url', 'extra_permissions_url'] as $field) {

which instead could be

foreach ( array( 'license_url', 'attribution_url', 'source_work_url', 'extra_permissions_url' ) as $field) {

As explained here :)
However, I don't see any reason why we should be using a syntax that is not backwards-compatible, since there is another that is. I have just submitted PR #56 fixing the issue :)

from wp-plugin-creativecommons.

BjornW avatar BjornW commented on July 3, 2024

May I suggest to define the array outside of the loop?

This is:

  1. more readable
  2. better performance (although I doubt you'll notice) due to the array being defined each foreach call.

Instead of:
foreach ( array( 'license_url', 'attribution_url', 'source_work_url', 'extra_permissions_url' ) as $field) {

I'd suggest:

$license_metadata = array( 'license_url', 'attribution_url', 'source_work_url', 'extra_permissions_url' );
foreach( $license_metadata as $field) {

from wp-plugin-creativecommons.

TheCrowned avatar TheCrowned commented on July 3, 2024

Totally! Just done that :)

from wp-plugin-creativecommons.

ahmadbilaldev avatar ahmadbilaldev commented on July 3, 2024

Issue fixed in PR #56.

from wp-plugin-creativecommons.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.