CodeCabin / wp-google-maps

WP Google Maps
16 stars 12 forks source link

Scan Dependencies Conflict #1016

Closed shazahm1 closed 2 years ago

shazahm1 commented 2 years ago

I spent more time than I wish to admit debugging why the "pro" script dependencies were being loaded by the plugin even though the Pro version was not activated (or even installed).

The folder path just happened to have -pro, causing the regex to return true.

$pro_directory = (preg_match('/-pro/', $dir) ? true : false);

Please consider making the regex more specific so it will only return true if -pro is within the plugins folder. Example:

 $pro_directory = (preg_match('/.*\/plugins\/.*-pro/', $dir) ? true : false);
DylanCodeCabin commented 2 years ago

@shazahm1 Thank you for bringing that to my attention!

I see how this could derail the scrip loader in some use cases/environments.

I've added this to our internal repo and it will be tended to as part of the V9 build I mentioned in your other threads.

Appreciate you taking the time to share a working solution as well! 🚀

DylanCodeCabin commented 2 years ago

Fixed in V9 builds, slightly different regex specificity, but functionally the same -> To be released soon!