Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mu-plugin/plausible-proxy-speed-module.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ private function is_proxy_request() {
return false;
}

$path = parse_url( $this->request_uri, PHP_URL_PATH );
$path = wp_parse_url( $this->request_uri, PHP_URL_PATH );

if ( ! is_string( $path ) || $path === '' ) {
return false;
Expand Down
4 changes: 2 additions & 2 deletions src/Admin/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public function uninstall() {
$file_path = WP_CONTENT_DIR . '/mu-plugins/plausible-proxy-speed-module.php';

if ( file_exists( $file_path ) ) {
unlink( $file_path );
wp_delete_file( $file_path );
}

if ( get_option( 'plausible_analytics_created_mu_plugins_dir' ) && $this->dir_is_empty( WPMU_PLUGIN_DIR ) ) {
Expand All @@ -142,7 +142,7 @@ public function uninstall() {
$js_file = $this->get_filename();

if ( file_exists( $cache_dir . $js_file . '.js' ) ) {
unlink( $cache_dir . $js_file . '.js' ); // @codeCoverageIgnore
wp_delete_file( $cache_dir . $js_file . '.js' ); // @codeCoverageIgnore
}

if ( $this->dir_is_empty( $cache_dir ) ) {
Expand Down
2 changes: 1 addition & 1 deletion src/Cron.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ private function download_file( $remote_file, $local_file ) {
* Some servers don't do a full overwrite if file already exists, so we delete it first.
*/
if ( file_exists( $local_file ) ) {
unlink( $local_file );
wp_delete_file( $local_file );
}

$write = file_put_contents( $local_file, wp_remote_retrieve_body( $file_contents ) );
Expand Down
4 changes: 2 additions & 2 deletions src/Proxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ public function do_request( $name = 'pageview', $domain = '', $url = '', $props
*/
public function generate_event_url() {
$url = '';
$parts = parse_url( $_SERVER[ 'REQUEST_URI' ] );
$home_url_parts = parse_url( get_home_url() );
$parts = wp_parse_url( $_SERVER[ 'REQUEST_URI' ] );
$home_url_parts = wp_parse_url( get_home_url() );

if ( isset( $home_url_parts[ 'scheme' ] ) && isset( $home_url_parts[ 'host' ] ) && isset( $parts[ 'path' ] ) ) {
$url = $home_url_parts[ 'scheme' ] . '://' . $home_url_parts [ 'host' ] . $parts[ 'path' ];
Expand Down
2 changes: 1 addition & 1 deletion src/Uninstall.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ private function delete_proxy_speed_module() {
$file_path = WP_CONTENT_DIR . '/mu-plugins/plausible-proxy-speed-module.php';

if ( file_exists( $file_path ) ) {
unlink( $file_path );
wp_delete_file( $file_path );
}
}
}
Loading