transifex / transifex-live-wordpress

Wordpress plugin for Transifex Live
https://wordpress.org/plugins/transifex-live-integration/
Other
7 stars 9 forks source link

Hreflang generator should respect http protocol #213

Closed ThemisB closed 4 years ago

ThemisB commented 4 years ago

This PR is related with an issue that is addressed on https://github.com/transifex/transifex-live-wordpress/issues/210.

Problem

The href link that contains the hreflang attribute was agnostic of the browser's HTTP protocol and solely relied on the settings that users saved on the plugin page. That means, that if the administrators accessed the plugin through the HTTPS version of the site and performed an update operation then the tokenized_url value will have an https suffix. The tokenized_url value will have an http suffix if the update action is performed through the HTTP protocol, respectively.

This can be verified by running the following query.

SELECT option_name, option_value
FROM wp_options
WHERE option_name='transifex_live_settings';

Solution

The generated link of the target languages should adhere to the HTTP protocol of the client request.

Other Changes

  1. We update the travis.yml to run tests on all branches. Currently tests were run only on master and devel branches.
  2. Update codeception to version 4 and also add the codeception/module-asserts, since it is a requirement for the newer codeception versions.
  3. Change all tests to use the newly introduced BaseTestCase class.
  4. Fix the breaking ReverseHardLinkTest.
  5. Remove the _bootstrap.php from the codeception.yml, since it is deprecated. Note: Some of the work relies on the changes suggested on this PR.